2010-10-26 12:53:39 +04:00
|
|
|
//
|
2023-02-04 21:21:53 +03:00
|
|
|
// Simple example of an interactive spreadsheet using Fl_Table.
|
|
|
|
// Uses Mr. Satan's technique of instancing an Fl_Input around.
|
2010-10-26 12:53:39 +04:00
|
|
|
//
|
2023-02-04 21:21:53 +03:00
|
|
|
// Copyright 1998-2023 by Bill Spitzak and others.
|
2010-10-26 12:53:39 +04:00
|
|
|
//
|
2011-07-19 08:49:30 +04:00
|
|
|
// This library is free software. Distribution and use rights are outlined in
|
|
|
|
// the file "COPYING" which should have been included with this file. If this
|
|
|
|
// file is missing or damaged, see the license at:
|
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// https://www.fltk.org/COPYING.php
|
2010-10-26 12:53:39 +04:00
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// Please see the following page on how to report bugs and issues:
|
2010-10-26 12:53:39 +04:00
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// https://www.fltk.org/bugs.php
|
2010-10-26 12:53:39 +04:00
|
|
|
//
|
2023-02-04 21:21:53 +03:00
|
|
|
|
|
|
|
// Modified to test Jean-Marc's mods for keyboard nav and mouse selection.
|
|
|
|
//
|
|
|
|
// Fl_Table[1.00/LGPL] 04/18/03 Mister Satan -- Initial implementation, submitted to erco for Fl_Table
|
|
|
|
// Fl_Table[1.10/LGPL] 05/17/03 Greg Ercolano -- Small mods to follow changes to Fl_Table
|
|
|
|
// Fl_Table[1.20/LGPL] 02/22/04 Jean-Marc Lienher -- Keyboard nav and mouse selection
|
|
|
|
// Fl_Table[1.21/LGPL] 02/22/04 Greg Ercolano -- Small reformatting mods, comments
|
|
|
|
// FLTK[1.3.0/LGPL] 10/26/10 Greg Ercolano -- Moved from Fl_Table to FLTK 1.3.x, CMP compliance
|
|
|
|
|
2010-12-10 21:24:47 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2010-10-26 12:53:39 +04:00
|
|
|
#include <FL/Fl.H>
|
|
|
|
#include <FL/Fl_Double_Window.H>
|
2010-12-10 21:24:47 +03:00
|
|
|
#include <FL/Fl_Table.H>
|
2010-10-26 12:53:39 +04:00
|
|
|
#include <FL/Fl_Int_Input.H>
|
|
|
|
#include <FL/Fl_Value_Slider.H>
|
|
|
|
#include <FL/fl_draw.H>
|
|
|
|
|
|
|
|
const int MAX_COLS = 26;
|
|
|
|
const int MAX_ROWS = 500;
|
|
|
|
|
2010-12-10 21:24:47 +03:00
|
|
|
class Spreadsheet : public Fl_Table {
|
2020-07-01 19:03:10 +03:00
|
|
|
Fl_Int_Input *input; // single instance of Fl_Int_Input widget
|
|
|
|
int values[MAX_ROWS][MAX_COLS]; // array of data for cells
|
|
|
|
int row_edit, col_edit; // row/col being modified
|
|
|
|
int s_left, s_top, s_right, s_bottom; // kb nav + mouse selection
|
2010-10-26 12:53:39 +04:00
|
|
|
|
|
|
|
protected:
|
2022-12-30 21:14:36 +03:00
|
|
|
void draw_cell(TableContext context,int=0,int=0,int=0,int=0,int=0,int=0) FL_OVERRIDE;
|
2020-07-01 19:03:10 +03:00
|
|
|
void event_callback2(); // table's event callback (instance)
|
|
|
|
static void event_callback(Fl_Widget*, void *v) { // table's event callback (static)
|
2010-12-10 21:24:47 +03:00
|
|
|
((Spreadsheet*)v)->event_callback2();
|
|
|
|
}
|
2020-07-01 19:03:10 +03:00
|
|
|
static void input_cb(Fl_Widget*, void* v) { // input widget's callback
|
2010-12-10 21:24:47 +03:00
|
|
|
((Spreadsheet*)v)->set_value_hide();
|
|
|
|
}
|
2010-10-26 12:53:39 +04:00
|
|
|
|
|
|
|
public:
|
2010-12-10 21:24:47 +03:00
|
|
|
Spreadsheet(int X,int Y,int W,int H,const char* L=0) : Fl_Table(X,Y,W,H,L) {
|
2010-10-26 12:53:39 +04:00
|
|
|
callback(&event_callback, (void*)this);
|
|
|
|
when(FL_WHEN_NOT_CHANGED|when());
|
2010-12-10 21:24:47 +03:00
|
|
|
// Create input widget that we'll use whenever user clicks on a cell
|
|
|
|
input = new Fl_Int_Input(W/2,H/2,0,0);
|
2010-10-26 12:53:39 +04:00
|
|
|
input->hide();
|
|
|
|
input->callback(input_cb, (void*)this);
|
2020-07-01 19:03:10 +03:00
|
|
|
input->when(FL_WHEN_ENTER_KEY_ALWAYS); // callback triggered when user hits Enter
|
2010-10-26 12:53:39 +04:00
|
|
|
input->maximum_size(5);
|
2011-01-28 04:34:22 +03:00
|
|
|
row_edit = col_edit = 0;
|
|
|
|
s_left = s_top = s_right = s_bottom = 0;
|
2010-12-10 21:24:47 +03:00
|
|
|
for (int c = 0; c < MAX_COLS; c++)
|
|
|
|
for (int r = 0; r < MAX_ROWS; r++)
|
2020-07-01 19:03:10 +03:00
|
|
|
values[r][c] = (r + 2) * (c + 3); // initialize cells
|
2010-10-26 12:53:39 +04:00
|
|
|
end();
|
|
|
|
}
|
2010-12-10 21:24:47 +03:00
|
|
|
~Spreadsheet() { }
|
2010-10-26 12:53:39 +04:00
|
|
|
|
2010-12-10 21:24:47 +03:00
|
|
|
// Apply value from input widget to values[row][col] array and hide (done editing)
|
|
|
|
void set_value_hide() {
|
|
|
|
values[row_edit][col_edit] = atoi(input->value());
|
|
|
|
input->hide();
|
2020-07-01 19:03:10 +03:00
|
|
|
window()->cursor(FL_CURSOR_DEFAULT); // XXX: if we don't do this, cursor can disappear!
|
2010-12-10 21:24:47 +03:00
|
|
|
}
|
2010-10-26 14:39:19 +04:00
|
|
|
// Change number of rows
|
2022-12-30 21:14:36 +03:00
|
|
|
void rows(int val) FL_OVERRIDE {
|
2010-10-26 14:39:19 +04:00
|
|
|
Fl_Table::rows(val);
|
2010-10-26 12:53:39 +04:00
|
|
|
}
|
2010-10-26 14:39:19 +04:00
|
|
|
// Change number of columns
|
2022-12-30 21:14:36 +03:00
|
|
|
void cols(int val) FL_OVERRIDE {
|
2010-10-26 14:39:19 +04:00
|
|
|
Fl_Table::cols(val);
|
2010-10-26 12:53:39 +04:00
|
|
|
}
|
2010-10-26 14:39:19 +04:00
|
|
|
// Get number of rows
|
2010-10-26 12:53:39 +04:00
|
|
|
inline int rows() {
|
|
|
|
return Fl_Table::rows();
|
|
|
|
}
|
2010-10-26 14:39:19 +04:00
|
|
|
// Get number of columns
|
2010-10-26 12:53:39 +04:00
|
|
|
inline int cols() {
|
|
|
|
return Fl_Table::cols();
|
|
|
|
}
|
2010-12-10 21:24:47 +03:00
|
|
|
// Start editing a new cell: move the Fl_Int_Input widget to specified row/column
|
|
|
|
// Preload the widget with the cell's current value,
|
|
|
|
// and make the widget 'appear' at the cell's location.
|
|
|
|
//
|
|
|
|
void start_editing(int R, int C) {
|
2020-07-01 19:03:10 +03:00
|
|
|
row_edit = R; // Now editing this row/col
|
2010-12-10 21:24:47 +03:00
|
|
|
col_edit = C;
|
|
|
|
int X,Y,W,H;
|
2020-07-01 19:03:10 +03:00
|
|
|
find_cell(CONTEXT_CELL, R,C, X,Y,W,H); // Find X/Y/W/H of cell
|
|
|
|
input->resize(X,Y,W,H); // Move Fl_Input widget there
|
|
|
|
char s[30]; sprintf(s, "%d", values[R][C]); // Load input widget with cell's current value
|
2010-12-10 21:24:47 +03:00
|
|
|
input->value(s);
|
2023-02-04 21:21:53 +03:00
|
|
|
input->insert_position(0, int(strlen(s))); // Select entire input field
|
2020-07-01 19:03:10 +03:00
|
|
|
input->show(); // Show the input widget, now that we've positioned it
|
2010-12-10 21:24:47 +03:00
|
|
|
input->take_focus();
|
|
|
|
}
|
|
|
|
// Tell the input widget it's done editing, and to 'hide'
|
|
|
|
void done_editing() {
|
2020-07-01 19:03:10 +03:00
|
|
|
if (input->visible()) { // input widget visible, ie. edit in progress?
|
|
|
|
set_value_hide(); // Transfer its current contents to cell and hide
|
2010-12-10 21:24:47 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// Return the sum of all rows in this column
|
|
|
|
int sum_rows(int C) {
|
|
|
|
int sum = 0;
|
2020-07-01 19:03:10 +03:00
|
|
|
for (int r=0; r<rows()-1; ++r) // -1: don't include cell data in 'totals' column
|
2010-12-10 21:24:47 +03:00
|
|
|
sum += values[r][C];
|
|
|
|
return(sum);
|
|
|
|
}
|
|
|
|
// Return the sum of all cols in this row
|
|
|
|
int sum_cols(int R) {
|
|
|
|
int sum = 0;
|
2020-07-01 19:03:10 +03:00
|
|
|
for (int c=0; c<cols()-1; ++c) // -1: don't include cell data in 'totals' column
|
2010-12-10 21:24:47 +03:00
|
|
|
sum += values[R][c];
|
|
|
|
return(sum);
|
|
|
|
}
|
|
|
|
// Return the sum of all cells in table
|
|
|
|
int sum_all() {
|
|
|
|
int sum = 0;
|
2020-07-01 19:03:10 +03:00
|
|
|
for (int c=0; c<cols()-1; ++c) // -1: don't include cell data in 'totals' column
|
|
|
|
for (int r=0; r<rows()-1; ++r) // -1: ""
|
|
|
|
sum += values[r][c];
|
2010-12-10 21:24:47 +03:00
|
|
|
return(sum);
|
2010-10-26 12:53:39 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
// Handle drawing all cells in table
|
2010-12-10 21:24:47 +03:00
|
|
|
void Spreadsheet::draw_cell(TableContext context, int R,int C, int X,int Y,int W,int H) {
|
2020-07-01 19:03:10 +03:00
|
|
|
static char s[30];
|
2010-10-26 12:53:39 +04:00
|
|
|
switch ( context ) {
|
2020-07-01 19:03:10 +03:00
|
|
|
case CONTEXT_STARTPAGE: // table about to redraw
|
2010-10-26 12:53:39 +04:00
|
|
|
// Get kb nav + mouse 'selection region' for use below
|
|
|
|
get_selection(s_top, s_left, s_bottom, s_right);
|
|
|
|
break;
|
|
|
|
|
2020-07-01 19:03:10 +03:00
|
|
|
case CONTEXT_COL_HEADER: // table wants us to draw a column heading (C is column)
|
|
|
|
fl_font(FL_HELVETICA | FL_BOLD, 14); // set font for heading to bold
|
|
|
|
fl_push_clip(X,Y,W,H); // clip region for text
|
2010-10-26 12:53:39 +04:00
|
|
|
{
|
2020-07-01 19:03:10 +03:00
|
|
|
fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, col_header_color());
|
|
|
|
fl_color(FL_BLACK);
|
|
|
|
if (C == cols()-1) { // Last column? show 'TOTAL'
|
|
|
|
fl_draw("TOTAL", X,Y,W,H, FL_ALIGN_CENTER);
|
|
|
|
} else { // Not last column? show column letter
|
|
|
|
sprintf(s, "%c", 'A' + C);
|
|
|
|
fl_draw(s, X,Y,W,H, FL_ALIGN_CENTER);
|
|
|
|
}
|
2010-10-26 12:53:39 +04:00
|
|
|
}
|
|
|
|
fl_pop_clip();
|
|
|
|
return;
|
|
|
|
|
2020-07-01 19:03:10 +03:00
|
|
|
case CONTEXT_ROW_HEADER: // table wants us to draw a row heading (R is row)
|
|
|
|
fl_font(FL_HELVETICA | FL_BOLD, 14); // set font for row heading to bold
|
2010-12-10 21:24:47 +03:00
|
|
|
fl_push_clip(X,Y,W,H);
|
2010-10-26 12:53:39 +04:00
|
|
|
{
|
2020-07-01 19:03:10 +03:00
|
|
|
fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, row_header_color());
|
|
|
|
fl_color(FL_BLACK);
|
|
|
|
if (R == rows()-1) { // Last row? Show 'Total'
|
|
|
|
fl_draw("TOTAL", X,Y,W,H, FL_ALIGN_CENTER);
|
|
|
|
} else { // Not last row? show row#
|
|
|
|
sprintf(s, "%d", R+1);
|
|
|
|
fl_draw(s, X,Y,W,H, FL_ALIGN_CENTER);
|
|
|
|
}
|
2010-10-26 12:53:39 +04:00
|
|
|
}
|
|
|
|
fl_pop_clip();
|
|
|
|
return;
|
|
|
|
|
2020-07-01 19:03:10 +03:00
|
|
|
case CONTEXT_CELL: { // table wants us to draw a cell
|
2010-10-26 12:53:39 +04:00
|
|
|
if (R == row_edit && C == col_edit && input->visible()) {
|
2020-07-01 19:03:10 +03:00
|
|
|
return; // dont draw for cell with input widget over it
|
2010-10-26 12:53:39 +04:00
|
|
|
}
|
2010-12-10 21:24:47 +03:00
|
|
|
// Background
|
2010-12-10 10:49:22 +03:00
|
|
|
// Keyboard nav and mouse selection highlighting
|
|
|
|
if (R >= s_top && R <= s_bottom && C >= s_left && C <= s_right) {
|
2020-07-01 19:03:10 +03:00
|
|
|
fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, FL_YELLOW);
|
2010-12-10 21:24:47 +03:00
|
|
|
} else if ( C < cols()-1 && R < rows()-1 ) {
|
2020-07-01 19:03:10 +03:00
|
|
|
fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, FL_WHITE);
|
2010-12-10 10:49:22 +03:00
|
|
|
} else {
|
2020-07-01 19:03:10 +03:00
|
|
|
fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, 0xbbddbb00); // money green
|
2010-10-26 12:53:39 +04:00
|
|
|
}
|
2010-12-10 21:24:47 +03:00
|
|
|
// Text
|
2010-10-26 12:53:39 +04:00
|
|
|
fl_push_clip(X+3, Y+3, W-6, H-6);
|
|
|
|
{
|
2020-07-01 19:03:10 +03:00
|
|
|
fl_color(FL_BLACK);
|
|
|
|
if (C == cols()-1 || R == rows()-1) { // Last row or col? Show total
|
|
|
|
fl_font(FL_HELVETICA | FL_BOLD, 14); // ..in bold font
|
|
|
|
if (C == cols()-1 && R == rows()-1) { // Last row+col? Total all cells
|
|
|
|
sprintf(s, "%d", sum_all());
|
|
|
|
} else if (C == cols()-1) { // Row subtotal
|
|
|
|
sprintf(s, "%d", sum_cols(R));
|
|
|
|
} else if (R == rows()-1) { // Col subtotal
|
|
|
|
sprintf(s, "%d", sum_rows(C));
|
|
|
|
}
|
|
|
|
fl_draw(s, X+3,Y+3,W-6,H-6, FL_ALIGN_RIGHT);
|
|
|
|
} else { // Not last row or col? Show cell contents
|
|
|
|
fl_font(FL_HELVETICA, 14); // ..in regular font
|
|
|
|
sprintf(s, "%d", values[R][C]);
|
|
|
|
fl_draw(s, X+3,Y+3,W-6,H-6, FL_ALIGN_RIGHT);
|
|
|
|
}
|
2010-10-26 12:53:39 +04:00
|
|
|
}
|
|
|
|
fl_pop_clip();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2020-07-01 19:03:10 +03:00
|
|
|
case CONTEXT_RC_RESIZE: { // table resizing rows or columns
|
2010-10-26 12:53:39 +04:00
|
|
|
if (!input->visible()) return;
|
|
|
|
find_cell(CONTEXT_TABLE, row_edit, col_edit, X, Y, W, H);
|
|
|
|
if (X==input->x() && Y==input->y() && W==input->w() && H==input->h()) {
|
2020-07-01 19:03:10 +03:00
|
|
|
return; // no change? ignore
|
2010-10-26 12:53:39 +04:00
|
|
|
}
|
|
|
|
input->resize(X,Y,W,H);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Callback whenever someone clicks on different parts of the table
|
2010-12-10 21:24:47 +03:00
|
|
|
void Spreadsheet::event_callback2() {
|
2010-10-26 12:53:39 +04:00
|
|
|
int R = callback_row();
|
|
|
|
int C = callback_col();
|
2020-07-01 19:03:10 +03:00
|
|
|
TableContext context = callback_context();
|
2010-10-26 14:39:19 +04:00
|
|
|
|
2010-10-26 12:53:39 +04:00
|
|
|
switch ( context ) {
|
2020-07-01 19:03:10 +03:00
|
|
|
case CONTEXT_CELL: { // A table event occurred on a cell
|
|
|
|
switch (Fl::event()) { // see what FLTK event caused it
|
|
|
|
case FL_PUSH: // mouse click?
|
|
|
|
done_editing(); // finish editing previous
|
|
|
|
if (R != rows()-1 && C != cols()-1 ) // only edit cells not in total's columns
|
|
|
|
start_editing(R,C); // start new edit
|
|
|
|
return;
|
2010-10-26 12:53:39 +04:00
|
|
|
|
2020-07-01 19:03:10 +03:00
|
|
|
case FL_KEYBOARD: // key press in table?
|
|
|
|
if ( Fl::event_key() == FL_Escape ) exit(0); // ESC closes app
|
|
|
|
if (C == cols()-1 || R == rows()-1) return; // no editing of totals column
|
|
|
|
done_editing(); // finish any previous editing
|
|
|
|
set_selection(R, C, R, C); // select the current cell
|
|
|
|
start_editing(R,C); // start new edit
|
|
|
|
if (Fl::event() == FL_KEYBOARD && Fl::e_text[0] != '\r') {
|
|
|
|
input->handle(Fl::event()); // pass keypress to input widget
|
|
|
|
}
|
|
|
|
return;
|
2010-10-26 12:53:39 +04:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2020-07-01 19:03:10 +03:00
|
|
|
case CONTEXT_TABLE: // A table event occurred on dead zone in table
|
|
|
|
case CONTEXT_ROW_HEADER: // A table event occurred on row/column header
|
2010-10-26 12:53:39 +04:00
|
|
|
case CONTEXT_COL_HEADER:
|
2020-07-01 19:03:10 +03:00
|
|
|
done_editing(); // done editing, hide
|
2010-10-26 12:53:39 +04:00
|
|
|
return;
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-26 12:53:39 +04:00
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Change number of columns
|
|
|
|
void setcols_cb(Fl_Widget* w, void* v) {
|
2010-12-10 21:24:47 +03:00
|
|
|
Spreadsheet* table = (Spreadsheet*)v;
|
2010-10-26 12:53:39 +04:00
|
|
|
Fl_Valuator* in = (Fl_Valuator*)w;
|
|
|
|
int cols = int(in->value()) + 1;
|
|
|
|
table->cols(cols);
|
2010-12-10 21:24:47 +03:00
|
|
|
table->redraw();
|
2010-10-26 12:53:39 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Change number of rows
|
|
|
|
void setrows_cb(Fl_Widget* w, void* v) {
|
2010-12-10 21:24:47 +03:00
|
|
|
Spreadsheet* table = (Spreadsheet*)v;
|
2010-10-26 12:53:39 +04:00
|
|
|
Fl_Valuator* in = (Fl_Valuator*)w;
|
|
|
|
int rows = int(in->value()) + 1;
|
|
|
|
table->rows(rows);
|
2010-12-10 21:24:47 +03:00
|
|
|
table->redraw();
|
2010-10-26 12:53:39 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
int main() {
|
2020-07-01 19:03:10 +03:00
|
|
|
Fl::option(Fl::OPTION_ARROW_FOCUS, 1); // we want arrow keys to navigate table's widgets
|
2010-12-10 21:24:47 +03:00
|
|
|
Fl_Double_Window *win = new Fl_Double_Window(922, 382, "Fl_Table Spreadsheet with Keyboard Navigation");
|
|
|
|
Spreadsheet* table = new Spreadsheet(20, 20, win->w()-80, win->h()-80);
|
2010-10-26 14:39:19 +04:00
|
|
|
// Table rows
|
2010-10-26 12:53:39 +04:00
|
|
|
table->row_header(1);
|
|
|
|
table->row_header_width(70);
|
|
|
|
table->row_resize(1);
|
|
|
|
table->rows(11);
|
|
|
|
table->row_height_all(25);
|
2010-10-26 14:39:19 +04:00
|
|
|
// Table cols
|
2010-10-26 12:53:39 +04:00
|
|
|
table->col_header(1);
|
|
|
|
table->col_header_height(25);
|
|
|
|
table->col_resize(1);
|
|
|
|
table->cols(11);
|
|
|
|
table->col_width_all(70);
|
2020-07-01 19:03:10 +03:00
|
|
|
table->set_selection(0,0,0,0); // select top/left cell
|
2010-10-26 12:53:39 +04:00
|
|
|
|
|
|
|
// Add children to window
|
2010-12-10 10:49:22 +03:00
|
|
|
win->begin();
|
2010-10-26 12:53:39 +04:00
|
|
|
|
2010-10-26 14:39:19 +04:00
|
|
|
// Row slider
|
2010-12-10 10:49:22 +03:00
|
|
|
Fl_Value_Slider setrows(win->w()-40,20,20,win->h()-80, 0);
|
2010-10-26 12:53:39 +04:00
|
|
|
setrows.type(FL_VERT_NICE_SLIDER);
|
|
|
|
setrows.bounds(2,MAX_ROWS);
|
|
|
|
setrows.step(1);
|
|
|
|
setrows.value(table->rows()-1);
|
|
|
|
setrows.callback(setrows_cb, (void*)table);
|
|
|
|
setrows.when(FL_WHEN_CHANGED);
|
|
|
|
setrows.clear_visible_focus();
|
|
|
|
|
2010-10-26 14:39:19 +04:00
|
|
|
// Column slider
|
2010-12-10 10:49:22 +03:00
|
|
|
Fl_Value_Slider setcols(20,win->h()-40,win->w()-80,20, 0);
|
2010-10-26 12:53:39 +04:00
|
|
|
setcols.type(FL_HOR_NICE_SLIDER);
|
|
|
|
setcols.bounds(2,MAX_COLS);
|
|
|
|
setcols.step(1);
|
|
|
|
setcols.value(table->cols()-1);
|
|
|
|
setcols.callback(setcols_cb, (void*)table);
|
|
|
|
setcols.when(FL_WHEN_CHANGED);
|
|
|
|
setcols.clear_visible_focus();
|
|
|
|
|
2010-12-10 10:49:22 +03:00
|
|
|
win->end();
|
|
|
|
win->resizable(table);
|
|
|
|
win->show();
|
2010-10-26 12:53:39 +04:00
|
|
|
|
|
|
|
return Fl::run();
|
|
|
|
}
|