Solved

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

Posted on 2003-12-10
7
1,396 Views
Last Modified: 2013-12-26
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.
0
Comment
Question by:Mouah
  • 3
  • 2
7 Comments
 
LVL 15

Accepted Solution

by:
namasi_navaretnam earned 50 total points
ID: 9917953
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
 

Author Comment

by:Mouah
ID: 9918670
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
 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 9924664
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
 

Author Comment

by:Mouah
ID: 9926515
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
 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 9931886
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now