[fltk.commit] [Library] r9816 - in branches/branch-1.3: FL src
Author: manolo Date: 2013-02-08 03:58:19 -0800 (Fri, 08 Feb 2013) New Revision: 9816 Log: Mac OS text input: removed the Fl::marked_text_length() function that's not necessary. Modified: branches/branch-1.3/FL/Fl.H branches/branch-1.3/src/Fl_Input.cxx branches/branch-1.3/src/Fl_Input_.cxx branches/branch-1.3/src/Fl_Text_Display.cxx branches/branch-1.3/src/Fl_Text_Editor.cxx branches/branch-1.3/src/Fl_cocoa.mm branches/branch-1.3/src/Fl_compose.cxx Modified: branches/branch-1.3/FL/Fl.H === --- branches/branch-1.3/FL/Fl.H 2013-02-05 16:04:05 UTC (rev 9815) +++ branches/branch-1.3/FL/Fl.H 2013-02-08 11:58:19 UTC (rev 9816) @@ -142,10 +142,9 @@ static Fl_Widget* selection_owner_; static Fl_Window* modal_; static Fl_Window* grab_; - static int compose_state; + static int compose_state; // used for dead keys (WIN32) or marked text (MacOS) static void call_screen_init(); // recompute screen number and dimensions #ifdef __APPLE__ - static int marked_text_length(void); // returns length of marked text static void reset_marked_text(); // resets marked text static void insertion_point_location(int x, int y, int height); // sets window coordinates height of insertion point #endif Modified: branches/branch-1.3/src/Fl_Input.cxx === --- branches/branch-1.3/src/Fl_Input.cxx2013-02-05 16:04:05 UTC (rev 9815) +++ branches/branch-1.3/src/Fl_Input.cxx2013-02-08 11:58:19 UTC (rev 9816) @@ -359,8 +359,8 @@ Fl::event_text(), Fl::event_length()); } #ifdef __APPLE__ -if (Fl::marked_text_length()) { - this-mark( this-position() - Fl::marked_text_length() ); +if (Fl::compose_state) { + this-mark( this-position() - Fl::compose_state ); } #endif return 1; @@ -592,7 +592,7 @@ switch (event) { #ifdef __APPLE__ case FL_UNFOCUS: - if (Fl::marked_text_length()) { + if (Fl::compose_state) { this-mark( this-position() ); Fl::reset_marked_text(); } @@ -818,7 +818,7 @@ int Fl_Secret_Input::handle(int event) { int retval = Fl_Input::handle(event); #ifdef __APPLE__ - if (event == FL_KEYBOARD Fl::marked_text_length()) { + if (event == FL_KEYBOARD Fl::compose_state) { this-mark( this-position() ); // don't underline marked text } #endif Modified: branches/branch-1.3/src/Fl_Input_.cxx === --- branches/branch-1.3/src/Fl_Input_.cxx 2013-02-05 16:04:05 UTC (rev 9815) +++ branches/branch-1.3/src/Fl_Input_.cxx 2013-02-08 11:58:19 UTC (rev 9816) @@ -339,8 +339,8 @@ int offset2; if (pp = e) x2 = xpos + (float)expandpos(p, pp, buf, offset2); else offset2 = (int) strlen(buf); -#ifdef __APPLE__ // Mac OS: underline marked ( = selected + Fl::marked_text_length() != 0) text - if (Fl::marked_text_length()) { +#ifdef __APPLE__ // Mac OS: underline marked ( = selected + Fl::compose_state != 0) text + if (Fl::compose_state) { fl_color(textcolor()); } else @@ -351,8 +351,8 @@ fl_color(fl_contrast(textcolor(), selection_color())); } fl_draw(buf+offset1, offset2-offset1, x1, (float)(Y+ypos+desc)); -#ifdef __APPLE__ // Mac OS: underline marked ( = selected + Fl::marked_text_length() != 0) text - if (Fl::marked_text_length()) { +#ifdef __APPLE__ // Mac OS: underline marked ( = selected + Fl::compose_state != 0) text + if (Fl::compose_state) { fl_color( fl_color_average(textcolor(), color(), 0.6) ); float width = fl_width(buf+offset1, offset2-offset1); fl_line(x1, Y+ypos+height-1, x1+width, Y+ypos+height-1); @@ -374,7 +374,7 @@ // draw the cursor: if (Fl::focus() == this ( #ifdef __APPLE__ - Fl::marked_text_length() || + Fl::compose_state || #endif selstart == selend) position() = p-value() position() = e-value()) { Modified: branches/branch-1.3/src/Fl_Text_Display.cxx === --- branches/branch-1.3/src/Fl_Text_Display.cxx 2013-02-05 16:04:05 UTC (rev 9815) +++ branches/branch-1.3/src/Fl_Text_Display.cxx 2013-02-08 11:58:19 UTC (rev 9816) @@ -1942,7 +1942,7 @@ if (style PRIMARY_MASK) { if (Fl::focus() == (Fl_Widget*)this) { #ifdef __APPLE__ - if (Fl::marked_text_length()) background = color();// Mac OS: underline marked text + if (Fl::compose_state) background = color();// Mac OS: underline marked text else #endif background = selection_color(); @@ -1978,8 +1978,8 @@ fl_push_clip(X, Y, toX - X, mMaxsize); #endif fl_draw( string, nChars, X, Y + mMaxsize - fl_descent()); -#ifdef __APPLE__ // Mac OS: underline marked (= selected +
Re: [fltk.general] Code into Fl_group ?
Hi, Impossible to say: you have not provided enough information in your post, n= or enough context to make sense of the fluid fragments. sorry for inconvenience. In fact I'm not using fluid. I work currently on a software called ZynAddSubFx to give a better interface. The problem is : I have a class ADnoteVoice class ADvoicelistitem {open : {public Fl_Group} } { Function {make_window()} {open private } { Fl_Window ADnoteVoiceListItem {open private xywh {262 736 615 100} type Double box UP_FRAME class Fl_Group visible } {... etc That work perfectly. I have a button Fl_Button {} { label {Show Voice Parameters} callback {ADnoteVoice-show();} xywh {5 400 170 25} labelsize 12 } If I click on this the ADnoteVoice load in a separate window. This work perfectly too. I want the ADnoteVoice window not show as separate window but in main windows. I have created a Fl_group named test : Fl_Group test { label {VOICE PARAMETERS} open xywh {540 5 768 657} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17 } And modified the callback of the button Fl_Button {} { .. callback {ADnoteVoice-position(541,35);test-add(ADnoteVoice);ADnoteVoice-show();} .. } This work perfectly. If I click on the button The ADnoteVoice show embedded in the FL_group test. The problem is that I want this ADnoteVoice automatically show when the main window start without clicking on the button I have tested this code for the FL_Group : Fl_Group test { label {VOICE PARAMETERS} open xywh {540 5 768 657} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17 code {ADnoteVoice-position(541,35); test-add(ADnoteVoice); ADnoteVoice-show();} } But the software hang. I'm not understand really what append. Thanks in advance for your answer Best Regards Pierrotlo ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
Re: [fltk.general] Code into Fl_group ?
In fact I'm not using fluid. You must be using fluid: you are presenting fragments of fluid output here, which you presumably must be translating into C++ for compilation, and AFAIK fluid is the only tool around that knows how to convert fluid files into C++. However, perhaps you are hand-editing the fluid files? If so, do not do that! The fact that fluid files are *apparently* human-readable is not meant to indicate that they should be human-edited! It is possible, but that is *not* the point. Use the fluid GUI editor to manipulate the files. Don't hand-edit them! If you are determined to hand-edit the fluid files, then your best bet is to use fluid's GUI editor to make small, stand-alone, compileable and testable examples that implement the features you want. Then, for each of these, test the generated C++ to ensure that it does what you want, and if it does, study the fluid files and C++ files to see how that was done. Then copy those features into your hand-edited fluid sources. But... Really, just don't! Use fluid the way it was intended! This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
[fltk.general] Unable to change labelsize and labelfont fltk 1.3.2
Hi, We are facing issue in setting the labelsize and labelfont using fltk1.3.2 , It always sets to default size,font and color. We have build fltk1.3.2 with ./configure --shared --thread options. We were using fltk2.0 and were able to change the label size,font,color.Since after going through the articles on version we considered fltk1.3.2 is a stable version and moved from fltk2.0 to fltk1.3.2. Please can you help us in resolving this issue, Thanks, Sachin BM. ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
Re: [fltk.general] Unable to change labelsize and labelfont fltk 1.3.2
We are facing issue in setting the labelsize and labelfont using fltk1.3.2 , It always sets to default size,font and color. We have build fltk1.3.2 with ./configure --shared --thread options. We were using fltk2.0 and were able to change the label size,font,color.Since after going through the articles on version we considered fltk1.3.2 is a stable version and moved from fltk2.0 to fltk1.3.2. Please can you help us in resolving this issue, You'll need to show us what you are doing, since (as the saying goes) It works OK for me... Can you post a minimal, complete, compileable, sample that shows what you are doing and exhibits the fault? This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
[fltk.general] FL_LEAVE in Fl_Menu_Bar
In this program, I've derived from Fl_Menu_Bar and overridden the handle(int) function. That's because I need the submenu to pop up when the mouse enters the the menu, without the user having to press a mouse button. It seems that pulldown() doesn't return until I press Esc, and handle(FL_LEAVE) doesn't get called until then. Thinking of my Fl_Menu_Bar derived class and its submenus as a unit, I need to somehow detect as soon as the mouse cursor enters or leaves that unit, without requiring a keyboard press or mouse click. #include FL/Fl.H #include FL/Fl_Double_Window.H #include FL/Fl_Menu_Bar.H class MyBar : public Fl_Menu_Bar { public: MyBar(int X, int Y, int W, int H, const char *l=0) : Fl_Menu_Bar(X, Y, W, H, l) { } int handle(int e) { switch (e) { case FL_ENTER: { fprintf(stderr, FL_ENTER Calling pulldown()\n); const Fl_Menu_Item *v = menu()-pulldown(x(), y(), w(), h(), v, this, 0, 1); fprintf(stderr, FL_ENTER pulldown() returned\n); return 1; } case FL_LEAVE: fprintf(stderr, FL_LEAVE\n); break; } return Fl_Menu_Bar::handle(e); } }; int main(int argc, char **argv) { Fl_Double_Window *win = new Fl_Double_Window(300,250); MyBar* menubar = new MyBar (0,0,300,25); menubar-add(One); menubar-add(Two/A); menubar-add(Two/B); win-end(); win-show(); return(Fl::run()); } ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk