Changing dynamically WindowType ( transform a Main! windows to a Reponse! one )

Hello all,

I'd like to open an existing window, but as if it was a Response! type one.

In fact, I want a Powerbuilder program to open a window (not response most of time), and wait for the end of it's execution but without using timer stuff and/or Yield loop.

Thanks for your help

Pierre.
MouahAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

namasi_navaretnamCommented:
You can do:
w_mywindow.WindowType = Response!

Possible values are:
Child!
Main!
MDI!
MDIHelp!
Popup!
Response!

It is bit tricky to change from main to response window type as you will need to change some other properties before changing from main to response window type.
1) Open a window of type main
2) Change it to response winodow. Take a notice of all properties that change automatically. You willl need to change all those properties before changing to reponse or viceversa.

Properties of interest are,
MenuName
MinBox,
MaxBox,
Resizable

HTH

Namasi Navaretnam
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MouahAuthor Commented:
Namasi, thank you for your help

But where will I put script that change all this properties ?
I've tried these syntax, and Powerbuilder7 didn't accept any:

----------------------------------------------
SYNTAX 1
----------------------------------------------
MyWindow lw_test

Open( lw_test )

lw_test.MenuName = ""
... (some other properties)

lw_test.WindowType = Response!

--> <<Error: A ReadOnly property may only be modified  in an event  or function in its parent class>>

----------------------------------------------
SYNTAX 1
----------------------------------------------
In the MyWindow.Open or MyWindow.wf_function() or MyWindow.ue_Event()

this.WindowType = Response!

--> <<Error: A SystemWrite property may only be modified  in an event  or function in its parent class>>

What is 'event or function in its parent class' ?
Where will I code the WindowType property assignation ?

Thank you for your help

Pierre
0
namasi_navaretnamCommented:
Pierre,

This does not wok. I think it worked in an earlier version. (4 may be). I tried it with PB 9 and does work as you say.

You can use windows APIs to wait until a process complete.

See issue below:

http://www.experts-exchange.com/Programming/Programming_Languages/PowerBuilder/Q_20775852.html

Namasi
0
MouahAuthor Commented:
Namasi,

In fact, as I said, I didn't wait some 'Wait Loop' nether kernel DLL stuff.

But, I found by myself a sort of answer, but maybe you could help:

I created my "Main! Window", and exported the script.
In the 'on create' part, I added this code:
>>
on w_myWindow.create
this.st_test=create st_test
this.cb_someButton=create cb_someButton
this.Control[]={this.st_test,&
this.cb_someButton}
windowtype = f_windowtype( classname( this ))
end on
<<

With "f_windowtype()" a global function witch return a windowType enum variable.
By writing code in this function to choose at runtime my windowType, it's working fine. But I still have a problem: as this code is generated by PowerBuilder automaticly, each time I edit and save my object window, PowerBuilder rewrite the original code (without the call of my function).

I think in Powerbuilder9 it's possible to write your own code in 'system script', but I still using PowerBuilder 7. Is there a solution ? ( except re-export/import my script each time )

Thanks again.

Pierre
0
namasi_navaretnamCommented:
I would not even try it. It is not recommended to change exported file and they will be recreated when re-generating the objects. No. PB 9 does not allow it.

Try to use the win APIs. They work just fine.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.