• Welcome to PlanetSquires Forums.
 

Static controls

Started by Andre Smit, March 05, 2006, 01:59:25 PM

Previous topic - Next topic

Andre Smit

Is is possible to assign labels or other controls as static.

I declare this %IDC_STATIC = -1 and assign this constant to all my simple labels. This saves from having to give each a unique constant.

TechSupport

FireFly automatically assigns the control identifiers for you. You should have no need to create your own. Press the F4 key to display the popup list of all of the Window Handles and Control Identifiers that FireFly has created for your project.

Andre Smit

Thanks Paul

Just curious - is this not a waste of resources and memory and result in larger file sizes, especially if the control will never respond to any messages.

Roger Garstang

Interesting point...lots of DWORDs there, at least 2 for every Label.  Perhaps an option in FF3 would be like the Hide Label option already there that hides the Labels from being listed...only it would make FF's code use only 1 set of variables to create all labels

Mark Strickland

I have a FF project that has topped 360k lines of generated code.  PowerBASIC Win8 has a problem compiling it.  I have removed a few forms to continue my development.

PowerBASIC has a FIXUP OVERFLOW error.  I sent them the generated code and they now say it is a compiler bug and some table memory used during the compile is getting "stepped on".  I guess they never thought you might have a few thousand function declares.  My generated code in CODEGEN _...DECLARES.inc currently has 1,741 functions and 4,221 globals.

Between my code, lots of functions, lots of globals, and all the stuff FF generates memory use is BIG.

An option to do something different with at least labels might be interesting in FF 3.x.

TechSupport

This is a classic "ease of use" versus "memory" issue. Granted, these days the small amount of additional memory being consumed is certainly justified by the additional benefits derived from having FireFly generate the handles and identifiers for you. Having said that, there is no reason why FireFly3 could not have an option to generate one common identifier for all label controls.

Charles Dietz

Paul, since maybe 5% of the time you do need a unique identifier, could you add a property option box "Generate ID" for the labels that do need a unique identifier?  If box is unchecked then the common default value of -1 (or whatever) is used.

Roger Garstang

Or possibly detect which handles are used and only use variables for those and a temp variable for the rest that are never used.  I sometimes never even need to use the handle variables since FF has so many functions that actually pass handles in the messages, etc.

TechSupport

Quote from: "Roger Garstang"I sometimes never even need to use the handle variables since FF has so many functions that actually pass handles in the messages, etc.
Yes, that's true. There are a few places where the ID is needed (like getting the handle of a Rebar control). Also, if you are using multiple instances of a Form then you MUST use the ID to get the Windows handle (using GetDlgItem API).