Screen Layout difference MDICHILD vs DIALOG

Screen Layout difference MDICHILD vs DIALOG

Postby anserkk » Mon Sep 29, 2008 10:48 am

Friends,

I am on the process of developing an app. I have designed the screen with controls for a Dialog as shown below.

Dialog Screen snap shot

Image

But when I change this DIALOG to a MDICHILD Window, the whole screen layout get changed a lot. Please note I have NOT USED a resource editor, instead I have created the controls via code

Instead of DEFINE DIALOG oWnd I changed the code to DEFINE WINDOW oWnd MDICHILD

Instead of ACTIVATE DIALOG, I changed the code to ACTIVATE WINDOW

But you can see from the below given screen snapshot that the whole screen design has changed. Except the DBCOMBO all other controls size and layout has changed.

Another thing which I have noticed is that except DBCOMBO all other GET controls doesn't have border, but when I move the mouse over the GET's the BORDER is getting painted.

I would like to know whether something is wrong in my way of doing things or is this the default behaviour.

Screen Snapshot of MDICHILD

Image

Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Postby anserkk » Tue Sep 30, 2008 12:00 pm

Hello,

Instead of MDICHILD if I use DIALOG NOWAIT, then there is no problem with the screen layout and border painting of the GET's.

Noticable difference between DIALOG NOWAIT and MDICHILD which I have found is that :-

1) DIALOG NOWAIT does not have Minimize & Maximize button.
2) wndMain():oWndClient:aWnd[i] does not work


My App's starting Window is MDI. My intention for using MDICHILD window was that the user should not get struck with only a window at a time and If I use a DIALOG then the user will not be able to even Minimize the app without closing the DIALOG.

Is there anything wrong in this kind of environment. ie

1 ) Main window app MDI
2) All other Windows as DIALOG with NOWAIT clause.

Do other experienced users in this forum have faced any problem in this kind of environment.

The below given code to check any MDICHILD is already open or NOt will not work in the above said environment ie DIALOG with NOWAIT clause.

Can I have the equivalent code to check for DIALOG with NOWAIT

Mr.James Bott's code

Code: Select all  Expand view
*------------------------------------------------------*
Function wndSetFocus(cTitle)
*------------------------------------------------------*
/* Here is a function to prevent opening more than one copy of a MDI child window.
   It also brings the window to the top and set the focus to it. */
local i:=0,lSuccess:=.f.
cTitle:=upper(cTitle)
For i=1 to len(wndMain():oWndClient:aWnd)
  if upper( wndMain():oWndClient:aWnd[i]:cCaption )=cTitle
     wndMain():oWndClient:aWnd[i]:setFocus()
     lSuccess:=.t.
  endif
Next
Return lSuccess


Appreciate any feedback in this regard. I am struck at this point to take a decision which kind of window's to choose and proceed further.

Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Postby Antonio Linares » Tue Sep 30, 2008 9:53 pm

Anser,

Windows API uses "logical units" for dialogboxes, and "pixels" for windows, thats why you get that dimensions difference.

Non modal design uses to be more complex and buggy for beginners. But if you have already decided it, then go for it. We will help you :-)
regards, saludos

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

Postby anserkk » Fri Oct 03, 2008 6:21 am

Thank you Mr.Antonio for offering the help/support.

As of now, I think that DIALOG with NOWAIT is also serving my purpose. But I do not want my users to open the same DIALOG twice. The code which Mr.James has given to find out whether a particular MDICHILD window is open or not, will not work in the case of DIALOG's . What is the code to check whether a DIALOG is already open or not ?

The advantage I see of using DIALOG's with NOWAIT is that, I wil be able to use Resource Editors to design the dialogs.(Eventhough at this moment I am not using RC editors, may be in future).

As I have pointed in my post above, in MDICHILD window the border's of the GET's are getting painted only when I move the mouse over the GET's. Is there any technique to solve that problem ?. I tried oWnd:Refresh() but did not serve the purpose. There is also a black border line appearing around the xBrowse.

In MDICHILD window, I have also found that the shifting of FOCUS from and to GET control is also different from GET controls in a DIALOG.

Screen snapshot of the MDICHILD window for your reference.

Image
[URL=http://g.imageshack.us/img213/mdi

Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 43 guests