mirror of
https://github.com/fltk/fltk.git
synced 2026-06-01 14:52:46 +08:00
Control resizing behavior of UI buttons
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13099 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+25
-1
@@ -89,6 +89,7 @@ main(int argc, // I - Number of command-line arguments
|
|||||||
{
|
{
|
||||||
Fl_Double_Window *window;// Main window
|
Fl_Double_Window *window;// Main window
|
||||||
Fl_Button *button;// Buttons
|
Fl_Button *button;// Buttons
|
||||||
|
Fl_Group *grp; // Groups
|
||||||
Fl_File_Icon *icon; // New file icon
|
Fl_File_Icon *icon; // New file icon
|
||||||
|
|
||||||
|
|
||||||
@@ -109,6 +110,10 @@ main(int argc, // I - Number of command-line arguments
|
|||||||
tty = new Fl_Simple_Terminal(0,215,window->w(),TERMINAL_HEIGHT);
|
tty = new Fl_Simple_Terminal(0,215,window->w(),TERMINAL_HEIGHT);
|
||||||
tty->ansi(true);
|
tty->ansi(true);
|
||||||
|
|
||||||
|
// Group: limit resizing to filter input (not browse button)
|
||||||
|
grp = new Fl_Group(0,10,400,25);
|
||||||
|
grp->begin();
|
||||||
|
{
|
||||||
filter = new Fl_Input(50, 10, 315, 25, "Filter:");
|
filter = new Fl_Input(50, 10, 315, 25, "Filter:");
|
||||||
// Process standard arguments and find filter argument if present
|
// Process standard arguments and find filter argument if present
|
||||||
int argn = 1;
|
int argn = 1;
|
||||||
@@ -134,7 +139,14 @@ main(int argc, // I - Number of command-line arguments
|
|||||||
// Fallback if no icon found
|
// Fallback if no icon found
|
||||||
button->label("..");
|
button->label("..");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
grp->end();
|
||||||
|
grp->resizable(filter);
|
||||||
|
|
||||||
|
// Group: prevent resizing of the light buttons
|
||||||
|
grp = new Fl_Group(0,45,400,55);
|
||||||
|
grp->begin();
|
||||||
|
{
|
||||||
button = new Fl_Light_Button(50, 45, 80, 25, "MULTI");
|
button = new Fl_Light_Button(50, 45, 80, 25, "MULTI");
|
||||||
button->callback((Fl_Callback *)multi_callback);
|
button->callback((Fl_Callback *)multi_callback);
|
||||||
|
|
||||||
@@ -149,12 +161,24 @@ main(int argc, // I - Number of command-line arguments
|
|||||||
ch_extra->add("none|encodings group|check button");
|
ch_extra->add("none|encodings group|check button");
|
||||||
ch_extra->value(0);
|
ch_extra->value(0);
|
||||||
ch_extra->callback((Fl_Callback *)extra_callback);
|
ch_extra->callback((Fl_Callback *)extra_callback);
|
||||||
|
}
|
||||||
|
grp->end();
|
||||||
|
grp->resizable(0);
|
||||||
//
|
//
|
||||||
files = new Fl_File_Browser(50, 105, 340, 75, "Files:");
|
files = new Fl_File_Browser(50, 105, 340, 75, "Files:");
|
||||||
files->align(FL_ALIGN_LEFT);
|
files->align(FL_ALIGN_LEFT);
|
||||||
|
|
||||||
button = new Fl_Button(340, 185, 50, 25, "Close");
|
// Prevent resizing close button, but keep at right edge of scrn
|
||||||
|
grp = new Fl_Group(0,185,400,25);
|
||||||
|
grp->begin();
|
||||||
|
{
|
||||||
|
Fl_Box *invis = new Fl_Box(100,185,1,1);
|
||||||
|
invis->box(FL_NO_BOX);
|
||||||
|
button = new Fl_Button(310, 185, 80, 25, "Close");
|
||||||
button->callback((Fl_Callback *)close_callback);
|
button->callback((Fl_Callback *)close_callback);
|
||||||
|
grp->resizable(invis);
|
||||||
|
}
|
||||||
|
grp->end();
|
||||||
|
|
||||||
window->resizable(files);
|
window->resizable(files);
|
||||||
window->end();
|
window->end();
|
||||||
|
|||||||
Reference in New Issue
Block a user