FLTK logo

[fltk/fltk] Suggestion: pass the focus state as a parameter to `Fl_Input_::drawtext` (#211)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.issues  ]
 
Previous Message ]New Message | Reply ]Next Message ]

[fltk/fltk] Suggestion: pass the focus state as a parameter to `Fl_Input_::drawtext` (#211) Rangi Apr 06, 2021  
 

Fl_Input::draw and Fl_File_Input::draw both call Fl_Input_::drawtext to do the majority of their drawing. This method has repeated checks for whether Fl::focus() == this, which control whether to draw the cursor and selection. If Fl::focus() == this were passed to drawtext as a bool focused parameter, it would be easier to extend the Fl_Input class for custom grouped widgets. The drawtext method does not modify the focus state, so it would be valid as a passed parameter.

(My own use case is an Fl_Input that pops up an Fl_Browser with autocomplete suggestions within an Fl_Menu_Window when you start typing. So far it passes events down to the Fl_Input so the popup menu can coexist with continuing to type, but the cursor and selection do not show up.)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.