FLTK logo

[fltk/fltk] RFC: STR 2145: Fix box types and focus frames. (PR #958)

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] RFC: STR 2145: Fix box types and focus frames. (PR #958) Matthias Melcher 12:57 Apr 24  
 

2145

This is a big PR and it needs some explanation. The STR itself asks to fix the issue that the focus frame on some box types is just a rectangle and does not match the graphics of the frame or box. I fixed this by adding a focus-drawing callback to the box type array. That part was a few lines of code.

As a bigger refactoring, I removed all the box types starting with an underline, like _FL_PLASTIC_UP_BOX and replaced the no-underscore FL_PLASTIC_UP_BOX macros with direct enumeration values. The original code jumped through some really interesting hoops that helped linkers optimize unused code away. If an app never called _FL_PLASTIC_UP_BOX, the code to draw the plastic boxes would never be referenced, and a good linker could optimize and remove all plastic drawing routines.

Switch to 2024, and FLTK offers -scheme as a command line argument. This means that we always must link all possible drawing code, including the Plastic scheme and all others. So the whole macro setup and dynamic creation of the box type array is obsolete and wastes time and space, and adds complexity.

So I removed all the code that is no longer needed. Comments welcome.


You can view, comment on, or merge this pull request online at:

  https://github.com/fltk/fltk/pull/958

Commit Summary

  • aee2f47 Fix box types and focus frames.

File Changes

(21 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <fltk/fltk/pull/958@github.com>

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'.