assign object properties in sub form

Doug Easterbrook doug at artsman.com
Thu Nov 24 15:22:47 UTC 2022


hi Martin

to add to what Andy says, everything works, if you have the reference right.    

I do a couple of things when I think the references might be difficult

option 1:
if you open your window
use notation inspector to click on the item of interest (you’ll have the full notation)
open the properties dialog
change the property manually (which lets you see if it works)

if you see what you want, then you have both the notation path PLUS the property you want.



option 2:  (my preferred one)


 since I like to rearrange windows and put stuff in group boxes or page panes or scrollbox elements, sometimes long after the original code is written, its a high likelihood that I will break notation some place.

to detect a bad reference: 
I make sure I have an error handler loaded that will break out the debugger if I have bad notation references.

to mititagate ever getting them.


If I know that I want to refer to object and properties in some specific things, then I will make a item reference in the $construct of the object.


example:   In a lot of windows, I typically have a tabPane

so I add a $construct method in the tab pane.  the code is:



set reference iTabPaneRef to $cfield




If I want to refer to any property or field in the tab pane, I just need to do thinkgs like

calculate itabPaneRef.$height as .. 
calculate itabPaneRef.$edgefloat as ..



that way, I don’t worry about determining the notation and I know its always right because I declare the item reference to the window object in the $construct.


it is far easier than looking for the notation.





so for your page pane.

$construct

set reference iMyPagePane as $cfield



then later on


Do iMyPagePane.$objs.ef_name.$bordercolor.$assign(kRed)




or, it the field ef_name is going to be manipulated a lot, then put a construct in that field as 


$construct

set reference iEF_NAMEref as $cfield



then you can use the following, no matter how you rearrange the window or wher eyou put the variable

Do  iEF_NAMEref.$bordercolor.$assign(kRed)




it makes for safe defensive coding.


hope that helps.



Doug Easterbrook
Arts Management Systems Ltd.
mailto:doug at artsman.com
http://www.artsman.com
Phone (403) 650-1978

> On Nov 24, 2022, at 7:00 AM, TBS <andyh at totallybrilliant.com> wrote:
> 
> Martin
> 
> To my knowledge there are no constraints as such - but the real key is to absolutely make sure your reference is correct….
> 
> I typically put in a breakpoint and use the Notation Inspector to drill down to the object I want - and of course your reference has to be exactly correct !!!
> 
> But once you have that bit - then the Property manager will confirm the property name and ability to be assigned…...
> 
> On a quick guess - looking at your reference, if this is indeed a paged pane then you likely need the pane object in the middle there - but of course that’s just a guess !!
> 
> Andy Hilton
> Totally Brilliant Software Inc
> Phone (US) : (863) 409 4870
> Phone (UK) : 0207 193 8582
> Web : www.totallybrilliant.com
> Helpdesk : https://totallybrilliantsoftware.supportsystem.com/
> Email : andyh at totallybrilliant.com
> On Nov 24, 2022, 9:43 AM -0500, Martin Obongita via omnisdev-en <omnisdev-en at lists.omnis-dev.com>, wrote:
>> Hi @all,
>> I am trying to assign a property to an object in a subwindow with the command below in the method $construct:
>> 
>> 
>> 
>> Do $cinst.$objs.pagedPaneGeneral.$objs.ef_name.$bordercolor.$assign(kRed)
>> 
>> 
>> 
>> But the color of the object does not seem to change the border color.
>> What are the constrains with objects in a sub form when assigning properties?
>> 
>> 
>> RegardsMartin.
>> _____________________________________________________________
>> Manage your list subscriptions at https://lists.omnis-dev.com
>> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list