PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Static controls  (Read 463 times)

Andre Smit

  • Guest
Static controls
« on: March 05, 2006, 01:59:25 PM »

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

TechSupport

  • Guest
Static controls
« Reply #1 on: March 05, 2006, 03:16:02 PM »

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

Andre Smit

  • Guest
Static controls
« Reply #2 on: March 07, 2006, 11:22:47 PM »

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

Roger Garstang

  • Guest
Static controls
« Reply #3 on: March 08, 2006, 01:08:36 AM »

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
Logged

Mark Strickland

  • Guest
Could Be A Problem
« Reply #4 on: March 09, 2006, 10:28:20 AM »

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

TechSupport

  • Guest
Static controls
« Reply #5 on: March 09, 2006, 11:59:11 AM »

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

Charles Dietz

  • Guest
Static controls
« Reply #6 on: March 09, 2006, 05:10:48 PM »

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

Roger Garstang

  • Guest
Static controls
« Reply #7 on: March 09, 2006, 06:45:21 PM »

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

TechSupport

  • Guest
Static controls
« Reply #8 on: March 09, 2006, 10:20:17 PM »

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).
Logged