vTaskBar on the left MDIChild Window on the Right

vTaskBar on the left MDIChild Window on the Right

Postby reinaldocrespo » Mon Sep 27, 2010 1:59 pm

Hi everyone;

I'm currently using a Vertical SButtonBar of Manuel Mercado to show often used shortcuts to open mdi child windows that contain browses. I'd like to change that to use a VTaskBar:

Here is how it looks now:
Image

The problem with using a vTaskBar, or any other control for that matter, is that an MDI child window could potentially be dragged over the control even when using a splitter. Like this:
Image

Any ideas on how to avoid?


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: vTaskBar on the left MDIChild Window on the Right

Postby James Bott » Tue Sep 28, 2010 3:14 pm

Hi Reinaldo,

Don't use MDI windows. Use a panel instead. Make your app into a SDI (single document interface) similar to Outlook.

MDI windows are a nightmare for both users and programmers.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: vTaskBar on the left MDIChild Window on the Right

Postby reinaldocrespo » Tue Sep 28, 2010 4:05 pm

James;

Hi.

Yes, I know what you mean and time has proven your point. I must admit, I sort of expected that answer from you. I remember back when MDI idea was first introduced, we all wanted to do mdi regardless of the confusion it causes to the end user. We now want to stay away for some exceptions.

However, this app has been out there and working for quite a few years now and allows mdis for browsing of a few tables and using the buttons on the bar you switch focus from one table to another. I'm not sure that I want to re-do it so that you must close one browse to open a different one.

I was kind of hoping that an mdi child wnd could not be dragged outside a given parent window region. That would allow me to draw a more visually appealing control, such as a VTaskBar, on the Left instead of the regular window taskbar.

Well, guess I'll keep the vertical obar control for now.

Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: vTaskBar on the left MDIChild Window on the Right

Postby James Bott » Tue Sep 28, 2010 4:16 pm

Reinaldo,

I'm not sure that I want to re-do it so that you must close one browse to open a different one.


You don't have to close and open the browses. Just hide() and show() the panels--basically the same you do with MDI windows.

I can't think of anything you can do with MDI that you can't do with SDI. You will have to try harder to find something (grin).

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: vTaskBar on the left MDIChild Window on the Right

Postby James Bott » Tue Sep 28, 2010 4:38 pm

Here is a video of an SDI app made with FW (many years ago).

http://www.mediafire.com/?b7ss8zqjar8nc35

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: vTaskBar on the left MDIChild Window on the Right

Postby reinaldocrespo » Tue Sep 28, 2010 5:07 pm

Thank you for the link. Looks good.

I'm not saying it is impossible to imitate mdi with sdi or even undesirable. I'm saying it is already working with mdi. I don't like to go back and change code that is working unless there is a bug to be fixed AND your changes will please the customers.

I call this my KIS (keep it simple) principle or my stay away from TPS ("The Perfectionist Syndrome). :-)

Thank you very much,



Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: vTaskBar on the left MDIChild Window on the Right

Postby James Bott » Tue Sep 28, 2010 7:25 pm

Reinaldo,

I understand your reluctance to change.

Please explain more about what you are doing now. You say you are using sbuttonbar now without a problem? And you want to use VTaskbar? What is VTaskbar, is that a FW class? I can't find it.

You can any control has the problem, but you are using sbuttonbar. Is that not a control?

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: vTaskBar on the left MDIChild Window on the Right

Postby reinaldocrespo » Tue Sep 28, 2010 8:03 pm

Good question. TsButton, TsButtonBar... are classes contributed by Manuel Mercado. Very good work! TsButtonBar is analogous to FW BottonBar which is a standard windows control. It is usually drawn horizontally as the first control on the window. I draw it vertically on the main parent window only to avoid having two horizontal button bars next to each other, albeit one belongs to the parent and the other to the child. Again, I know that's why you speak of sdi and I agree. If the world was perfect... ;-)

That I know of, the windows bar (as in oWnd:obar), is the only control that you can't move a window over, thus hiding the control.

VtaskBar is analogous to the FW class Explorer bar? (I think that's what it is called). I can't remember if VtaskBar was a Canal Five contribution. I will probably end up using the explorer bar, but happen to refer to it as VTaskBar (as in Vertical bar with Tasks).

Checkout vTaskBar in action:

Image

BTW - I bet I can guess the weather in SD. 66 degrees F on a clear blue sky.


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: vTaskBar on the left MDIChild Window on the Right

Postby James Bott » Tue Sep 28, 2010 8:21 pm

Reinaldo,

Now I remember VTaskBar--I have a copy of it somewhere. I have used Manuel's TSButtons and bar too.

Below is sample code of how to simulate an SDI interface using MDI. Of course, this would also require some modification of your code--perhaps less than converting to SDI, but you would have to do both to determine which was less.

You would have been correct about the weather until two days ago. We are having a record heatwave. All summer it has been unseasonably cool, but yesterday it was 113F/45C in our East county areas and it was 107F/42C where I was at noon. Right now here it is only 81F/27C. I have the AC on but I have only used it three times this summer. Saturday we spent the entire day at the beach on Coronado where the weather was really nice in spite of the heat elsewhere. Ah, I love San Diego...

Regards,
James

Code: Select all  Expand view
/*
Purpose : Simulate a SDI interface using MDI
App     :
Author  : James Bott, jbott@compuserve.com
Company : Intellitech, gointellitech.com
Date    : 09/28/10 12:50:51
Language: Fivewin Harbour/xHarbour
Notes   :
*/


#include "Fivewin.ch"

function main()
   local oWnd
   define window oWnd mdi title "Simulate SDI with MDI"
   activate window oWnd on init Init()
return nil

function Init()
   local oBar, oBar2, oWnd, oWnd2

   define buttonbar oBar of wndMain()
   define button of oBar action oWnd:setfocus()
   define button of oBar action oWnd2:setfocus()
   oBar:goLeft()

   define window oWnd mdichild ;
     nominimize nosysmenu;
     color CLR_BLACK,CLR_BLUE ;
     of wndMain()
   activate window oWnd maximized

   define window oWnd2 mdichild ;
     nominimize nosysmenu;
     color CLR_BLACK,CLR_RED ;
     of wndMain()
   define buttonbar oBar2 of oWnd2 3d
   activate window oWnd2 maximized

return nil
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: vTaskBar on the left MDIChild Window on the Right

Postby James Bott » Tue Sep 28, 2010 8:43 pm

Reinaldo,

I had written my sample code before I read your last message. If you use the Explorerbar class you don't need either MDI child widnows or a panel. You can put browses directly on the window.

However, if you want to have buttonbars for each browse then you would have to use a panel.

I have not tried MDI child windows with the Explorerbar.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: vTaskBar on the left MDIChild Window on the Right

Postby James Bott » Tue Sep 28, 2010 8:58 pm

Reinaldo,

OK, below is an Explorerbar with MDI.

There is a problem--the main window menu shows the Window menu allowing users to mess up the maximized mdi child windows. You would either have to not have a main window menu or you would have to modify the FW menu source to keep the mdi child windows from showing up on the menu.

You don't have this issue with SDI.

Regards,
James

Code: Select all  Expand view
/*
Purpose : Test ExplorerBar with MDI
Author  : James Bott, jbott@compuserve.com
Company : Intellitech, gointellitech.com
Date    : 09/28/10 13:53:39
Language: Fivewin Harbour/xHarbour
Notes   :

*/



#include "fivewin.ch"
#include "color.ch"

static oWnd1, oWnd2

function main()
   local oWnd, oBar

   define window oWnd title "Test Explorerbar with MDI Windows" MDI

   define buttonbar oBar of oWnd 3d

   oWnd:oLeft:= buildExbar(oWnd)

   activate window oWnd on init Init()

return nil

//---------------------------------------------------------------------------//

Function Init()
   local oBar, oBar2

   define window oWnd1 mdichild ;
     nominimize nosysmenu;
     color CLR_BLACK,CLR_BLUE ;
     of wndMain()
   activate window oWnd1 maximized

   define window oWnd2 mdichild ;
     nominimize nosysmenu;
     color CLR_BLACK,CLR_RED ;
     of wndMain()
   define buttonbar oBar2 of oWnd2 3d
   activate window oWnd2 maximized

return nil

//---------------------------------------------------------------------------//

function buildExbar( oWnd )

   local oExBar, oPanel1

   oExBar = TExplorerBar():New(0,0,150,400,oWnd)

   oPanel1 = oExBar:AddPanel( "One", "c:\fwh\bitmaps\32x32\people.bmp" )
   oPanel1:lSpecial = .T.
   oPanel1:AddLink( "Providers", {|| oWnd1:setfocus()}, "c:\fwh\bitmaps\16x16\additem.bmp" )
   oPanel1:AddLink( "Patients", {|| oWnd2:setFocus()}, "c:\fwh\bitmaps\16x16\copy.bmp" )

return oExBar

//----------------------------------------------------------------------------//
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: vTaskBar on the left MDIChild Window on the Right

Postby James Bott » Tue Sep 28, 2010 10:35 pm

Reinaldo,

This is a crude fix for the Windows menu problem in my previous code example. Changing these two lines to maximize the MDI child window before setting focus, will fix a screen that has been messed up by the user selecting to cascade, split vertically, or horizontally the open windows.

Regards,
James

oPanel1:AddLink( "Providers", {|| oWnd1:maximize(), oWnd1:setfocus()}, "c:\fwh\bitmaps\16x16\additem.bmp" )
oPanel1:AddLink( "Patients", {|| oWnd2:maximize(), oWnd2:setFocus()}, "c:\fwh\bitmaps\16x16\copy.bmp" )
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: vTaskBar on the left MDIChild Window on the Right

Postby reinaldocrespo » Tue Sep 28, 2010 11:12 pm

James;

Thank you very much. I really like the idea. You make it look so simple, I have no excuse not to try it.

Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: vTaskBar on the left MDIChild Window on the Right

Postby James Bott » Wed Sep 29, 2010 12:10 am

Reinaldo,

I feel obligated to say that SDI takes about the same amount of code as the MDI example. So if you are thinking of migrating to this MDI example then think twice about migrating to SDI.

With SDI you won't have the windows control issues previously discussed. You will also be able to add tabs, trees, toolbars, splitters, and other such controls. Since I don't work with MDI I don't know if you can use all these with MDI windows.

To be fair, I am not against MDI windows per se. It is just that the typical MDI interface requires too much overhead window manipulation by the user, so that style of interface I am not a fan of. IF, an interface can be designed using MDI Windows that looks like a typical SDI design, then that changes the picture. But then that would really be a SDI interface (just constructed using MDI windows). I am afraid that to do this would require a fair amount of changes to the FWH source code, however. And I just don't see any advantages.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: vTaskBar on the left MDIChild Window on the Right

Postby ukoenig » Wed Sep 29, 2010 1:35 pm

Explorerbar-sample, complete without MDI
A Buttonclick closes the Dialog on Screen and opens the selected one.
I can format / resize the different pannels, to create Gradient-backgrounds.
I could use any Brush as well.
Menue 4 still shows a < normal > Explorerbar-Pannel.

The Main-Window ( no Dialog activated )

Image

Dialog 1 activated with Button 1

Image

Button 2 closes Dialog 1 and opens Dialog 2

Image

Radio- and Checkbox
( only works with SBUTTON from Manuel Mercado )

Image

Best regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi and 92 guests