Dialog box Control

Post Reply
Arindam
Posts: 44
Joined: Sat Jul 29, 2006 5:03 pm
Location: Kolkata, India

Dialog box Control

Post by Arindam »

I need support for the following three:

i) While a dialogbox is working, if I close the same from CLOSE[X] button,
how can I trap the same ?

ii) What is the command to count, how many dialogbox are open at any
point of time ?

iii) For dialogbox, what is the similar command of WBOARD() ?

Sincerely
Arindam
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Dialog box Control

Post by Enrico Maria Giordano »

Arindam wrote:I need support for the following three:

i) While a dialogbox is working, if I close the same from CLOSE[X] button,
how can I trap the same ?
Use the VALID clause.
Arindam wrote:ii) What is the command to count, how many dialogbox are open at any
point of time ?
GetAllWin() returns an array containing all the open windows, dialogs and controls. Just scan it and check the ClassName() method of each object:

Code: Select all

FUNCTION NDIALOGS()

    LOCAL aWin := GETALLWIN()

    LOCAL nWin := NWINDOWS()

    LOCAL nDlg := 0

    LOCAL i

    FOR i = 1 TO nWin
        IF aWin[ i ]:ClassName = "TDIALOG"
            nDlg++
        ENDIF
    NEXT

    RETURN nDlg
Arindam wrote:iii) For dialogbox, what is the similar command of WBOARD() ?
I don't know what WBOARD() is, sorry.

EMG
Arindam
Posts: 44
Joined: Sat Jul 29, 2006 5:03 pm
Location: Kolkata, India

Post by Arindam »

Hi EnricoMaria,

Thanks for your reply.

About my iii> point, I am giving you the details.

WBoard() is a xHarbour function to allocates allowable screen area for MDIChield window on MDI.

In my case, I don't want to board the dialogbox on a particular logo placed on MDI window. While dialogbox Move by mouse, the dialogbox do not move on that Particular area.

Hope I can explain you properly.

Arindam
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Arindam,

Could you provide a small and self contained sample about how you use WBoard() ? Thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
Arindam
Posts: 44
Joined: Sat Jul 29, 2006 5:03 pm
Location: Kolkata, India

Post by Arindam »

Hello Antonio.

I did a project in my xCompany which was developed in Flagship [Multisoft Gmbh]. That was a hybrid application, which was run in Basic, Terminal and GUI Mode also. So far my memory the code was as follows:

• Code:
Function Main()
Local w1
Local Name := Space(20)
Local Phone := Space(8)
Local GetList := {}

w1 := Wopen(10, 12, 20, 50)
wCaption("Test Window")

wBOARD(5, 5, 25, 70) // if it is not specify, window move entire region
wMoveUser(.T.) // if it is omitted or .F. then window donot move

@ 2, 5 Say "Enter your Name and Tel No"
@ 4, 2 Say “Name”
@ 5, 2 Say “Tel”

@ 4, 8 Get Name
@ 5, 8 Get Phone

Read
Return Nil

In xHarbour, command description of wBoard() is :

• Description:
This function defines the screen area where windows are permitted.
Windows are subsequently only visible in this defined area. You can use
this function to protect an area of the screen from being overwritten with
windows, even when you allow the user to move the window
interactively. The boundaries designated by WBOARD() become the
screen boundaries for window functions.

Notes
WBOARD() is only effective when there are no open windows.
Always consider that closing individual windows or all the windows never
influences the setting of the window border. So if you neglect to
specifically eliminate the window border, you can have unanticipated
problems later when you open windows.

Please note that yet I have not developed any project in xHarbour as because while I go through the xHarbour, I learn about FiveWin. Now I am trying to do developed application in Fivewin.

Arindam
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Arindam,

FiveWin uses the Windows APIs as much as possible. Wboard() is not needed neither supported for a FiveWin application.

You can control the location of a window using oWnd:nTop, oWnd:nLeft, oWnd:nWidth and oWnd:nHeight.

Also if you want to restrict the dimensions of a certain window you may use the DATA aMinMaxInfo. There is a working sample at samples\TestSize.prg

On a MDI window it is possible to modify the container area for the MDI Child windows. Thats another possibility.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply