/* Burr Solver * Copyright (C) 2003-2006 Andreas Röver * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __GROUPS_EDITOR_H__ #define __GROUPS_EDITOR_H__ #include "Fl_Table.h" #include #include class puzzle_c; /* this is the groups editor table */ class GroupsEditor : public Fl_Table { /* the puzzle and the problem to edit */ puzzle_c * puzzle; unsigned int prob; /* the input line where the user inputs the value * it is places over the cell the user clicks onto */ Fl_Int_Input* input; /* the position inside the table where the imput line is */ int editShape, editGroup; /* the current maximum group number */ unsigned int maxGroup; /* was something changed? */ bool changed; /* this is the virtual function called by the table widget to * draw a single cell */ void draw_cell(TableContext context, int r = 0, int c = 0, int x = 0, int y = 0, int w = 0, int h = 0); public: GroupsEditor(int x, int y, int w, int h, puzzle_c * puzzle, unsigned int problem); /* add a group to the puzzle and a column to the table */ void addGroup(void); void cb_input(void); void cb_tab(void); bool getChanged(void) { return changed; } /* take over the currently edited value (if there is one) and * close the edit line */ void finishEdit(void); }; /* the window that contins the group edit table */ class groupsEditorWindow : public Fl_Double_Window { GroupsEditor * tab; public: groupsEditorWindow(puzzle_c * p, unsigned int pr); void cb_AddGroup(void); void cb_CloseWindow(void); bool changed(void) { return tab->getChanged(); } /* finish editing and close window */ void hide(void); }; #endif