Dialog box Control

Dialog box Control

Postby Arindam » Tue Aug 22, 2006 7:13 pm

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
Arindam
 
Posts: 44
Joined: Sat Jul 29, 2006 5:03 pm
Location: Kolkata, India

Re: Dialog box Control

Postby Enrico Maria Giordano » Tue Aug 22, 2006 8:13 pm

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  Expand view
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
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Arindam » Wed Aug 23, 2006 10:16 am

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
Arindam
 
Posts: 44
Joined: Sat Jul 29, 2006 5:03 pm
Location: Kolkata, India

Postby Enrico Maria Giordano » Wed Aug 23, 2006 10:58 am

Sorry, I'm not familiar with that function.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Wed Aug 23, 2006 4:38 pm

Arindam,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Arindam » Thu Aug 24, 2006 6:34 am

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
Arindam
 
Posts: 44
Joined: Sat Jul 29, 2006 5:03 pm
Location: Kolkata, India

Postby Antonio Linares » Thu Aug 24, 2006 7:37 am

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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 85 guests