Fl_ColumnManager Class Reference

An Fl_ColumnManager controlls the row sorting of an Fl_Browser. More...

#include <Fl_ColumnManager.H>

Inheritance diagram for Fl_ColumnManager:

List of all members.

Public Methods

  Fl_ColumnManager (int x, int y, int w, int h, const char *label=NULL)
  Standard fltk constructor. More...

int  handle (int event)
  Process click and drag events. More...

void  update ()
  Force sorting and redraw of controller. More...

void  set_browser (Fl_Browser *b)
  Identify the associated browser and establish a link with the it. More...

void  draw ()
  Response to fltk draw requests. More...


Protected Methods

void  draw_control (int c, int X, int Y, int W, int H)
  Draw control button for the specified column, it's box must be passed in. More...

void  click_control (int c, int X, int Y, int W, int H)
  Process a click for a specified control button, it's box must be passed in. More...

void  drag_control (int c, int X, int Y, int W, int H)
  Process a drag for a specified divider, the lefthand control button's box must be passed in. More...

void  for_each_column (void(Fl_ColumnManager::*action)(int col, int, int, int, int))
  Common utility for processing each column. More...


Static Protected Methods

void  scrollbar_callback (Fl_Widget *s, void *cm)
  Replacement callback for the browser's hscrollbar. More...


Protected Attributes

Fl_Browser *  B
  the associated browser.

int  mySortColumn
  the column to sort by.


Detailed Description

An Fl_ColumnManager controlls the row sorting of an Fl_Browser.

The class is designed to manage the row sorting of the text in an Fl_Browser. Depressing any column button will cause the rows to be sorted by the text in that column. It uses the column_widths() of the associated browser to draw itself. These widths can be changed interactively.


Constructor & Destructor Documentation

Fl_ColumnManager::Fl_ColumnManager int    x,


int    y,


int    w,


int    h,


const char *    label = NULL


 

Standard fltk constructor.

Defers associating the controlled browser. Sets the sorting column to none (-1).


Member Function Documentation

void Fl_ColumnManager::click_control int    c,


int    X,


int    Y,


int    W,


int    H

[protected]
 

Process a click for a specified control button, it's box must be passed in.

Excludes 3 pixels at the ends of the control button for resizing them.

void Fl_ColumnManager::drag_control int    c,


int    X,


int    Y,


int    W,


int    H

[protected]
 

Process a drag for a specified divider, the lefthand control button's box must be passed in.

Resizing via dragging requires the mouse be within 3 pixels of the control button dividers.

void Fl_ColumnManager::draw  
 

Response to fltk draw requests.

Uses the common utility for processing each column.

void Fl_ColumnManager::draw_control int    c,


int    X,


int    Y,


int    W,


int    H

[protected]
 

Draw control button for the specified column, it's box must be passed in.

Could be modified to draw a label in the control button.

void Fl_ColumnManager::for_each_column void(Fl_ColumnManager::*    action)(int col, int, int, int, int) [protected]
 

Common utility for processing each column.

Each column's box is calculated and then the action called for it.

int Fl_ColumnManager::handle int    event
 

Process click and drag events.

FL_PUSH checks for a click on each column control. FL_DRAG tries to drag the column divider, if close enough (+/-3 pixels).

void Fl_ColumnManager::scrollbar_callback Fl_Widget *    s,


void *    cm

[static, protected]
 

Replacement callback for the browser's hscrollbar.

Performs the same task as the fltk 1.1.4 callback does, but also forces the control manager to redraw.

void Fl_ColumnManager::set_browser Fl_Browser *    b
 

Identify the associated browser and establish a link with the it.

In addition to identifying the associated browser, the callback for the browser's hscrollbar is changed. This also sets the hscrollbar's user_data to point to this column manager.

void Fl_ColumnManager::update  
 

Force sorting and redraw of controller.

This should be called whenever the sorting needs to be done or the column widths have been changed directly through the browser.


The documentation for this class was generated from the following files:
source code written by Brian Grant at ANT-S, 2011 Research Dr. Livermore, CA  94550.