diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2023-01-01 21:53:07 +0100 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2023-01-12 19:21:09 +0100 |
| commit | bafd3fd3d792b530d39d3af06e087dc63d2a25a2 (patch) | |
| tree | 42f4d533490191a92a13863d07378820b04a7b9c /fluid/alignment_panel.fl | |
| parent | 79832b679f2d195eb3b0f30ca920a857cc133b2b (diff) | |
Add Fl_Scheme_Choice widget and use it in test programs
This widget offers the selection of all known FLTK schemes as a simple
widget based on Fl_Choice.
Some test and demo programs use Fl_Scheme_Choice to enable the developer
or user to switch schemes quickly for comparison.
Todo:
- add features to add new schemes during runtime (partially done)
- update status when the scheme is changed by Fl::scheme("...")
Diffstat (limited to 'fluid/alignment_panel.fl')
| -rw-r--r-- | fluid/alignment_panel.fl | 51 |
1 files changed, 15 insertions, 36 deletions
diff --git a/fluid/alignment_panel.fl b/fluid/alignment_panel.fl index 4e016220e..4525704ed 100644 --- a/fluid/alignment_panel.fl +++ b/fluid/alignment_panel.fl @@ -38,6 +38,9 @@ decl {\#include <FL/Fl_Text_Display.H>} {public local decl {\#include <FL/filename.H>} {public local } +decl {\#include <FL/Fl_Scheme_Choice.H>} {public local +} + decl {\#include <FL/Fl_Preferences.H>} {private global } @@ -47,11 +50,14 @@ decl {\#include <FL/fl_ask.H>} {private global decl {\#include <string.h>} {private global } +decl {void init_scheme(void);} { + comment {// initialize the scheme from preferences} selected public global +} + decl {extern struct Fl_Menu_Item *dbmanager_item;} {public local } -Function {make_project_window()} {open -} { +Function {make_project_window()} {} { Fl_Window project_window { label {Project Settings} open xywh {472 246 399 298} type Double hide @@ -168,50 +174,23 @@ set_modflag(-1, -1);} decl {extern void i18n_cb(Fl_Choice *,void *);} {public local } -decl {void scheme_cb(Fl_Choice *, void *);} {public local +decl {void scheme_cb(Fl_Scheme_Choice *, void *);} {public local } Function {make_settings_window()} {open } { Fl_Window settings_window { - label {GUI Settings} - xywh {442 538 360 355} type Double hide resizable + label {GUI Settings} open + xywh {701 666 360 355} type Double hide resizable code0 {o->size_range(o->w(), o->h());} non_modal } { Fl_Choice scheme_choice { label {Scheme: } callback scheme_cb open xywh {140 10 115 25} down_box BORDER_BOX labelfont 1 - code0 {int s;} - code1 {fluid_prefs.get("scheme", s, 0);} - code2 {scheme_choice->value(s);} - code3 {scheme_cb(0, 0);} - } { - MenuItem {} { - label Default - xywh {0 0 35 25} - } - MenuItem {} { - label None - xywh {0 0 35 25} - } - MenuItem {} { - label Plastic - xywh {0 0 35 25} - } - MenuItem {} { - label {GTK+} - xywh {10 10 35 25} - } - MenuItem {} { - label Gleam - xywh {20 20 35 25} - } - MenuItem {} { - label Oxy - xywh {30 30 35 25} - } - } + code0 {init_scheme();} + class Fl_Scheme_Choice + } {} Fl_Group {} {open xywh {20 43 330 161} labelfont 1 align 0 } { @@ -327,7 +306,7 @@ Function {make_shell_window()} {open tooltip {save the design to the .fl file before running the command} xywh {82 39 136 19} down_box DOWN_BOX labelsize 12 } Fl_Check_Button shell_writecode_button { - label {save source code} selected + label {save source code} tooltip {generate the source code and header file before running the command} xywh {82 59 120 19} down_box DOWN_BOX labelsize 12 } Fl_Check_Button shell_writemsgs_button { |
