Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2003-12-10
7
Medium Priority
?
1,553 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 200 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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. …
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
Suggested Courses
Course of the Month9 days, 17 hours left to enroll

927 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