Solved

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

Posted on 2003-12-10
7
1,374 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
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.

746 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

9 Experts available now in Live!

Get 1:1 Help Now