Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

get DWObject from script

5 posts in DataWindow Last posting was on 2009-02-03 21:23:04.0Z
David Hepburn Posted on 2009-02-03 11:12:13.0Z
From: "David Hepburn" <dhepburn2@hotmail.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: get DWObject from script
Lines: 1
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 12.0.1606
X-MimeOLE: Produced By Microsoft MimeOLE V12.0.1606
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4988268d$1@forums-1-dub>
Date: 3 Feb 2009 03:12:13 -0800
X-Trace: forums-1-dub 1233659533 10.22.241.152 (3 Feb 2009 03:12:13 -0800)
X-Original-Trace: 3 Feb 2009 03:12:13 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88723
Article PK: 417977

I have a window which has a datawindow on it that allows the user to paint
objects on it such as statictext & bitmaps. The painter window allows the
user to change the existing image/text object properties by clicking on an
object which brings up a popup window with all the properties for the object
(the position, etc.) where they can then edit them.
This all works fine but the problem I have is when the user wants to create
a new object. I create the object using dw_control.Modify('create blah blah
blah') but after that I want to bring up its properties by simulating the
user clicking on it once its created. So I force a clicked event:
dw_control.Event Post Clicked(1,1,1,dw_control.object.t_1) however the "t_1"
is variable and changes every time a new object, in this case a statictext
object, is created. eg. The next time a statictext is created it will be
called "t_2"
Now I'm trying to find a way to get the dwobject dynamically to pass it in
the forced Clicked but I haven't found a way to do it other than dot
notation, which of course won't work for me. I have the name of the new
object in a variable: ls_object_name so I need to be able to build up a
statement to get the dwobject.

Something like this - a "fictional" example:- (assuming ls_object_name
contains the value 't_100')
DWObject ldwo_object
ldwo_object = dw_control.object(ls_object_name)

Again, the equivalent dot notation (which I cannot use) is:
DWObject ldwo_object
ldwo_object = dw_control.object.t_100

Any ideas?


Chris Werner Posted on 2009-02-03 13:26:33.0Z
From: "Chris Werner" <cwAT{PleaseNoSpam}f-s.de>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4988268d$1@forums-1-dub>
Subject: Re: get DWObject from script
Lines: 71
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49884609$1@forums-1-dub>
Date: 3 Feb 2009 05:26:33 -0800
X-Trace: forums-1-dub 1233667593 10.22.241.152 (3 Feb 2009 05:26:33 -0800)
X-Original-Trace: 3 Feb 2009 05:26:33 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88724
Article PK: 417976

Hi David,

earlier answers to similar questions were answered advising
the use of an undokumented function:

dwObject ldwo_object
ldwo_object = dw_control.object.__get_attribute("t_1", false)

I don't know if that works for your situation and if I should
guess to use it at all.

BTW, calling the clicked event isn't good architecture. It would be
better to have a function which needs the name of the object as
string argument:

of_clicked(as_objtName)

and call this function in the cleicked event:

of_clicked(dwo.name)

Then you can call this function after you have created a new
object:

string ls_objtName
ls_objtName = "t_1" // or whatever
dw_control.modify(.....)
of_clicked(ls_objtName)

Best regards

Chris Werner
f+s software gmbh

"David Hepburn" <dhepburn2@hotmail.com> schrieb im Newsbeitrag
news:4988268d$1@forums-1-dub...

>I have a window which has a datawindow on it that allows the user to paint
>objects on it such as statictext & bitmaps. The painter window allows the
>user to change the existing image/text object properties by clicking on an
>object which brings up a popup window with all the properties for the
>object (the position, etc.) where they can then edit them.
> This all works fine but the problem I have is when the user wants to
> create a new object. I create the object using dw_control.Modify('create
> blah blah blah') but after that I want to bring up its properties by
> simulating the user clicking on it once its created. So I force a clicked
> event: dw_control.Event Post Clicked(1,1,1,dw_control.object.t_1) however
> the "t_1" is variable and changes every time a new object, in this case a
> statictext object, is created. eg. The next time a statictext is created
> it will be called "t_2"
> Now I'm trying to find a way to get the dwobject dynamically to pass it in
> the forced Clicked but I haven't found a way to do it other than dot
> notation, which of course won't work for me. I have the name of the new
> object in a variable: ls_object_name so I need to be able to build up a
> statement to get the dwobject.
>
> Something like this - a "fictional" example:- (assuming ls_object_name
> contains the value 't_100')
> DWObject ldwo_object
> ldwo_object = dw_control.object(ls_object_name)
>
> Again, the equivalent dot notation (which I cannot use) is:
> DWObject ldwo_object
> ldwo_object = dw_control.object.t_100
>
> Any ideas?
>
>
>
>


David Hepburn Posted on 2009-02-03 19:28:52.0Z
From: "David Hepburn" <dhepburn2@hotmail.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4988268d$1@forums-1-dub> <49884609$1@forums-1-dub>
Subject: Re: get DWObject from script
Lines: 2
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 12.0.1606
X-MimeOLE: Produced By Microsoft MimeOLE V12.0.1606
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49889af4@forums-1-dub>
Date: 3 Feb 2009 11:28:52 -0800
X-Trace: forums-1-dub 1233689332 10.22.241.152 (3 Feb 2009 11:28:52 -0800)
X-Original-Trace: 3 Feb 2009 11:28:52 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88728
Article PK: 417981

Thanks Chris - worked a treat...

"Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in message
news:49884609$1@forums-1-dub...
> Hi David,
>
> earlier answers to similar questions were answered advising
> the use of an undokumented function:
>
> dwObject ldwo_object
> ldwo_object = dw_control.object.__get_attribute("t_1", false)
>
> I don't know if that works for your situation and if I should
> guess to use it at all.
>
> BTW, calling the clicked event isn't good architecture. It would be
> better to have a function which needs the name of the object as
> string argument:
>
> of_clicked(as_objtName)
>
> and call this function in the cleicked event:
>
> of_clicked(dwo.name)
>
> Then you can call this function after you have created a new
> object:
>
> string ls_objtName
> ls_objtName = "t_1" // or whatever
> dw_control.modify(.....)
> of_clicked(ls_objtName)
>
> Best regards
>
> Chris Werner
> f+s software gmbh
>
> "David Hepburn" <dhepburn2@hotmail.com> schrieb im Newsbeitrag
> news:4988268d$1@forums-1-dub...
>>I have a window which has a datawindow on it that allows the user to paint
>>objects on it such as statictext & bitmaps. The painter window allows the
>>user to change the existing image/text object properties by clicking on an
>>object which brings up a popup window with all the properties for the
>>object (the position, etc.) where they can then edit them.
>> This all works fine but the problem I have is when the user wants to
>> create a new object. I create the object using dw_control.Modify('create
>> blah blah blah') but after that I want to bring up its properties by
>> simulating the user clicking on it once its created. So I force a clicked
>> event: dw_control.Event Post Clicked(1,1,1,dw_control.object.t_1) however
>> the "t_1" is variable and changes every time a new object, in this case a
>> statictext object, is created. eg. The next time a statictext is created
>> it will be called "t_2"
>> Now I'm trying to find a way to get the dwobject dynamically to pass it
>> in the forced Clicked but I haven't found a way to do it other than dot
>> notation, which of course won't work for me. I have the name of the new
>> object in a variable: ls_object_name so I need to be able to build up a
>> statement to get the dwobject.
>>
>> Something like this - a "fictional" example:- (assuming ls_object_name
>> contains the value 't_100')
>> DWObject ldwo_object
>> ldwo_object = dw_control.object(ls_object_name)
>>
>> Again, the equivalent dot notation (which I cannot use) is:
>> DWObject ldwo_object
>> ldwo_object = dw_control.object.t_100
>>
>> Any ideas?
>>
>>
>>
>>
>
>


M. Searer Posted on 2009-02-03 21:23:04.0Z
From: "M. Searer" <nospam@nospam.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4988268d$1@forums-1-dub> <49884609$1@forums-1-dub> <49889af4@forums-1-dub>
In-Reply-To: <49889af4@forums-1-dub>
Subject: Re: get DWObject from script
Lines: 80
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6001.18000
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4988b5b8@forums-1-dub>
Date: 3 Feb 2009 13:23:04 -0800
X-Trace: forums-1-dub 1233696184 10.22.241.152 (3 Feb 2009 13:23:04 -0800)
X-Original-Trace: 3 Feb 2009 13:23:04 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88731
Article PK: 417984

don't forget to vote for that ISUG enhancement - to make it a documented/supported function.

"David Hepburn" <dhepburn2@hotmail.com> wrote in message news:49889af4@forums-1-dub...
> Thanks Chris - worked a treat...
>
>
> "Chris Werner" <cwAT{PleaseNoSpam}f-s.de> wrote in message
> news:49884609$1@forums-1-dub...
>> Hi David,
>>
>> earlier answers to similar questions were answered advising
>> the use of an undokumented function:
>>
>> dwObject ldwo_object
>> ldwo_object = dw_control.object.__get_attribute("t_1", false)
>>
>> I don't know if that works for your situation and if I should
>> guess to use it at all.
>>
>> BTW, calling the clicked event isn't good architecture. It would be
>> better to have a function which needs the name of the object as
>> string argument:
>>
>> of_clicked(as_objtName)
>>
>> and call this function in the cleicked event:
>>
>> of_clicked(dwo.name)
>>
>> Then you can call this function after you have created a new
>> object:
>>
>> string ls_objtName
>> ls_objtName = "t_1" // or whatever
>> dw_control.modify(.....)
>> of_clicked(ls_objtName)
>>
>> Best regards
>>
>> Chris Werner
>> f+s software gmbh
>>
>> "David Hepburn" <dhepburn2@hotmail.com> schrieb im Newsbeitrag
>> news:4988268d$1@forums-1-dub...
>>>I have a window which has a datawindow on it that allows the user to paint
>>>objects on it such as statictext & bitmaps. The painter window allows the
>>>user to change the existing image/text object properties by clicking on an
>>>object which brings up a popup window with all the properties for the
>>>object (the position, etc.) where they can then edit them.
>>> This all works fine but the problem I have is when the user wants to
>>> create a new object. I create the object using dw_control.Modify('create
>>> blah blah blah') but after that I want to bring up its properties by
>>> simulating the user clicking on it once its created. So I force a clicked
>>> event: dw_control.Event Post Clicked(1,1,1,dw_control.object.t_1) however
>>> the "t_1" is variable and changes every time a new object, in this case a
>>> statictext object, is created. eg. The next time a statictext is created
>>> it will be called "t_2"
>>> Now I'm trying to find a way to get the dwobject dynamically to pass it
>>> in the forced Clicked but I haven't found a way to do it other than dot
>>> notation, which of course won't work for me. I have the name of the new
>>> object in a variable: ls_object_name so I need to be able to build up a
>>> statement to get the dwobject.
>>>
>>> Something like this - a "fictional" example:- (assuming ls_object_name
>>> contains the value 't_100')
>>> DWObject ldwo_object
>>> ldwo_object = dw_control.object(ls_object_name)
>>>
>>> Again, the equivalent dot notation (which I cannot use) is:
>>> DWObject ldwo_object
>>> ldwo_object = dw_control.object.t_100
>>>
>>> Any ideas?
>>>
>>>
>>>
>>>
>>
>>


JK Posted on 2009-02-03 13:39:08.0Z
From: JK <keese.john@jobcorps.org>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: get DWObject from script
Date: Tue, 3 Feb 2009 05:39:08 -0800 (PST)
Organization: http://groups.google.com
Lines: 45
Message-ID: <b19433b2-2f93-47bd-be58-508ead653a3b@z27g2000prd.googlegroups.com>
References: <4988268d$1@forums-1-dub>
NNTP-Posting-Host: 63.88.161.101
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1233668348 13746 127.0.0.1 (3 Feb 2009 13:39:08 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 3 Feb 2009 13:39:08 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: z27g2000prd.googlegroups.com; posting-host=63.88.161.101; posting-account=QKTdPQoAAABrFHuu-hEmA0fohO4w66Yq
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!border2.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!z27g2000prd.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88725
Article PK: 417978


On Feb 3, 5:12 am, "David Hepburn" <dhepbu...@hotmail.com> wrote:
> I have a window which has a datawindow on it that allows the user to paint
> objects on it such as statictext & bitmaps. The painter window allows the
> user to change the existing image/text object properties by clicking on an
> object which brings up a popup window with all the properties for the object
> (the position, etc.) where they can then edit them.
> This all works fine but the problem I have is when the user wants to create
> a new object. I create the object using dw_control.Modify('create blah blah
> blah') but after that I want to bring up its properties by simulating the
> user clicking on it once its created. So I force a clicked event:
> dw_control.Event Post Clicked(1,1,1,dw_control.object.t_1) however the "t_1"
> is variable and changes every time a new object, in this case a statictext
> object, is created. eg. The next time a statictext is created it will be
> called "t_2"
> Now I'm trying to find a way to get the dwobject dynamically to pass it in
> the forced Clicked but I haven't found a way to do it other than dot
> notation, which of course won't work for me. I have the name of the new
> object in a variable: ls_object_name  so I need to be able to build up a
> statement to get the dwobject.
>
> Something like this - a "fictional" example:-   (assuming ls_object_name
> contains the value 't_100')
> DWObject    ldwo_object
> ldwo_object = dw_control.object(ls_object_name)
>
> Again, the equivalent dot notation (which I cannot use) is:
> DWObject    ldwo_object
> ldwo_object = dw_control.object.t_100
>
> Any ideas?

Could you set a value (like the text value) immediately after doing
the "dw_control.create(..." and then loop through the controls on the
datawindow looking for that text...once found, save the "name" of the
object and change the text value back to blank?