> > There is some setting that you change at compile time of FLTK if you
> > don't like this. I can't remember what it is though. Anyone?
>
> src/Fl_Input.cxx, line #64 ff. (FLTK 1.1.8/svn r5837):
>
> // If you define this symbol as zero you will get the peculiar fltk
> // behavior where moving off the end of an input field will move the
> // cursor into the next field:
> // define it as 1 to prevent cursor movement from going to next field:
> #define NORMAL_INPUT_MOVE 0
>
> Another way to achieve this (without modifying FLTK sources) would be to
> derive your own widget(s) from Fl_Input and modify handle() to catch
> these keys when the cursor is at the beginning or end of the input,
> resp.. That's what I did, when I decided, not to modify the FLTK sources
> any more.

Hi,
If i define NORMAL_INPUT_MOVE as 1 then cursor fits inside one control. Is 
there any side effect if change this code in FLTK source? Or i should use the 
handle method to control it?

Below is the code to create a modeless dialog where i dont find any system menu 
when i create this dialog on heap.

#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>

class Cmywin : public Fl_Window
{
public:
  Cmywin(int X, int Y, int W, int H, const char  *L = 0);
private:
  Fl_Box *textbox;
};

Cmywin *mywindialog = 0;

Cmywin::Cmywin(int X, int Y, int W, int H, const char *L): Fl_Window(X, Y, W, 
H, L)
{
        {
                Cmywin *o = this;
                o->box(FL_DOWN_BOX);
                o->labelsize(12);

                { Fl_Box* o = textbox = new Fl_Box(5, 5, 285, 20);
                o->labelsize(12);
                o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
                o->label("There is no minimize/maximize button...");
                }

                o->position(Fl::w()/2-o->w()/2, Fl::h()/2-o->h()/2);
                o->color(28);
                o->set_modal();
                o->end();
        }
}

int main()
{
        mywindialog = new Cmywin(0,0,367, 100);
        mywindialog->end();
        mywindialog->show();
        return Fl::run();
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to