Re: Variable substitution
Mike777 wrote:
>
> Is there any way to write something like:
>
> global constant &TYPEOFCOMOBOTOBUILD&NAMEOFWIDGETTOBUILD = createEx( Combo,
> "", Window1, 432, 76, 588, 28*6, PBS_VERTICAL+LBS_NOINTEGRALHEIGHT, 0 )
>
> If that can't be done, can somebody suggest a workaround?
I would just store them in a sequence. Something like this:
sequence controls
controls = {{},{}}
procedure add_control( sequence name, sequence control )
controls[1] = append( controls[1], name )
controls[2] &= createEx( ... )
end procedure
function get_control( sequence name )
integer i
i = find(name,controls[1])
return controls[2][i]
end function
I don't think the overhead would be unwieldy on a modern PC.
Be sure to investigate Derek's awesome alternate method of creating
controls ("newUIObj"). See this:
http://www.users.bigpond.com/ddparnell/euphoria/Docs/DEFINING_CONTROL.htm#NEWUIOBJ
http://www.users.bigpond.com/ddparnell/euphoria/Docs/EVENT.htm#STARTAPP
I think Win32Lib should deprecate the old way. :)
The newUIObj functionality is very versatile. You could read whole
interface systems from a text file (or database!)... but there's a lot more
to it.
**********************************************
****************OMG!!!!!!!!!!*****************
**********************************************
Actually, now that I've typed all this up... Looks like the newUIObj
feature already has provision for calling named controls... So, either use
what I said above with the "old way," or go with the new and improved way.
Derek, you really should trumpet newUIObj+startApp. :)
I wonder how easy it would be to make the IDE output newUIObjs instead of
create()s... :)
|
Not Categorized, Please Help
|
|