Explorer Bar Class Issues

Explorer Bar Class Issues

Postby James Bott » Wed Aug 18, 2010 8:11 pm

Antonio,

I am just now trying the new Explorer bar class. I find a problem with the scrollbar when the bar is used on the main window. The scrollbar appears on the far right of the window, not on the right side of the bar as it should be.

Image

Uploaded with ImageShack.us


Regards,
James
Last edited by James Bott on Wed Aug 18, 2010 10:43 pm, edited 1 time in total.
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Explorer Bar Class Issues

Postby James Bott » Wed Aug 18, 2010 9:49 pm

Antonio,

Below is the test code for the above screenshot.


Regards,
James
Code: Select all  Expand view  RUN

/*
Purpose: Showing three objects in a window that resize automatically
Author : James Bott
Date   : 8/14/2010
*/


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

// Set width and height here.
#define EXPLORERBAR_WIDTH 150
#define EXPLORERBAR_HEIGHT 400


Function Main()
   local oWnd, oBar, oBrw, oExplBar, oScrollbar

   use C:\FWH\samples\customer

   define window oWnd title "Test"

   define buttonbar oBar of oWnd

   @ 0,50 Listbox oBrw fields of oWnd

   oWnd:oTop:= oBar
   oWnd:oLeft:= buildExbar( oWnd )
   oWnd:oClient:= oBrw

   activate window oWnd

return nil


Function BuildExbar( oWnd )

   local oExBar, oPanel1, oPanel2, oPanel3, oPanel4, bClick

   // test only
   bClick:={|| msgInfo( "clicked") }

   oExBar = TExplorerBar():New(0,0,EXPLORERBAR_WIDTH,EXPLORERBAR_HEIGHT,oWnd)

   oPanel1 = oExBar:AddPanel( "One", "c:\fwh\bitmaps\32x32\people.bmp" )
   oPanel1:lSpecial = .T.
   oPanel1:AddLink( "First item", bClick, "c:\fwh\bitmaps\16x16\additem.bmp" )
   oPanel1:AddLink( "Second item", bClick, "c:\fwh\bitmaps\16x16\copy.bmp" )

   oPanel2 = oExBar:AddPanel( "Two", "c:\fwh\bitmaps\32x32\case.bmp" )
   oPanel2:AddLink( "First item", bClick, "c:\fwh\bitmaps\16x16\adddbf.bmp" )
   oPanel2:AddLink( "Second item", bClick, "c:\fwh\bitmaps\16x16\delete0.bmp" )
   oPanel2:AddLink( "Third item", bClick, "c:\fwh\bitmaps\16x16\envelope.bmp" )
   oPanel2:AddLink( "Fourth item", bClick, "c:\fwh\bitmaps\16x16\copy.bmp" )

   oPanel3 = oExBar:AddPanel( "Three", "c:\fwh\bitmaps\32x32\graphics.bmp" )
   oPanel3:AddLink( "First item", bClick, "c:\fwh\bitmaps\16x16\adddbf.bmp" )
   oPanel3:AddLink( "Second item", bClick, "c:\fwh\bitmaps\16x16\delete0.bmp" )
   oPanel3:AddLink( "Third item", bClick, "c:\fwh\bitmaps\16x16\envelope.bmp" )

   oPanel4 = oExBar:AddPanel( "Four", "c:\fwh\bitmaps\32x32\graphics.bmp" )
   oPanel4:AddLink( "First item", bClick, "c:\fwh\bitmaps\16x16\additem.bmp" )
   oPanel4:AddLink( "Second item", bClick, "c:\fwh\bitmaps\16x16\copy.bmp" )
   oPanel4:AddLink( "Third item", bClick, "c:\fwh\bitmaps\16x16\adddbf.bmp" )
   oPanel4:AddLink( "Fourth item", bClick, "c:\fwh\bitmaps\16x16\delete0.bmp" )
   oPanel4:AddLink( "Fifth item", bClick, "c:\fwh\bitmaps\16x16\envelope.bmp" )

return oExBar

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

Re: Explorer Bar Class Issues

Postby James Bott » Wed Aug 18, 2010 10:42 pm

Antonio,

Well, I'm confused. In the TExplorerbar class, method checkScroll() it looks like you are adding two scrollbars, one on the parent window and another belonging to the Explorerbar itself. However, only the parent window's scrollbar shows up and it controls the Explorer bar.

Code: Select all  Expand view  RUN
  if lAnd( GetWindowLong( ::oWnd:hWnd, GWL_STYLE ), WS_VSCROLL ) .and. lVisible
      if ::oWnd:oVScroll == NIL .and. lVisible
         DEFINE SCROLLBAR ::oWnd:oVScroll VERTICAL OF ::oWnd
         ::oVScroll           = ::oWnd:oVScroll


I don't understand why the parent window's scrollbar would have anything to do with the Explorer bar or visa versa. Shouldn't there just be a scrollbar belonging to the control itself?

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

Re: Explorer Bar Class Issues

Postby James Bott » Thu Aug 19, 2010 12:47 am

Ok, I did some experimenting and I think I see the issue. It appears that you cannot put a scrollbar on a control (or a subclass of a control, like the Explorer bar). I was able to put the scrollbar directly on the control but it doesn't function.

I think the trick used in the Explorer bar class is to create a scrollbar on the parent window and then make a copy of it as the control's scrollbar. It appears on the window, but controls the control. This works but the scrollbar is in the wrong place and I don't think it is a good solution.

I see two possible fixes. 1) add whatever needed functionality back to the Explorer bar class that was changed or removed in the TControl class, or 2) put the control onto a panel (internal to the class) and then put the scrollbar on the panel. I don't know which would be the least amount of work.

I kind-of tried option 2 by putting an explorer bar on a panel (a panel outside the class) and then scrollbar appears automatically on the panel since it is the parent window. However, the actual control moves down on the panel under certain circumstances. I haven't figured out how to prevent this.

Anyone feel free to chime in with comments and/or ideas.

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

Re: Explorer Bar Class Issues

Postby Silvio » Wed Aug 25, 2010 2:27 pm

Any Solution ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Explorer Bar Class Issues

Postby James Bott » Wed Aug 25, 2010 3:39 pm

I've been working on it as time permits. It is taking me some time to figure out how scrollbars work.

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

Re: Explorer Bar Class Issues

Postby nageswaragunupudi » Wed Aug 25, 2010 5:52 pm

Mr. James

It appears that you cannot put a scrollbar on a control (or a subclass of a control


It is possible to attach scrollbars to controls. Examples multiedit, wbrowse, tcbrowse, xbrowse, etc.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Explorer Bar Class Issues

Postby James Bott » Wed Aug 25, 2010 6:26 pm

Rao,

Yes, I did find scrollbars on conrols.

I it just taking me quite some time to figure out how they work. Sometimes I just have to walk away and let my subconscious work on it.

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

Re: Explorer Bar Class Issues

Postby Daniel Garcia-Gil » Wed Aug 25, 2010 11:52 pm

Hello

i did so many change to enhanced/fix the vertical scroll bar. Now the scroll is over control, no over parent
will be in next build

sample
http://www.sitasoft.net/fivewin/samples/explbar.zip
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Explorer Bar Class Issues

Postby Antonio Linares » Wed Aug 25, 2010 11:56 pm

We are a great team! :-)
regards, saludos

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

Re: Explorer Bar Class Issues

Postby Wanderson » Thu Aug 26, 2010 1:16 am

Daniel Garcia-Gil wrote:Hello

i did so many change to enhanced/fix the vertical scroll bar. Now the scroll is over control, no over parent
will be in next build

sample
http://www.sitasoft.net/fivewin/samples/explbar.zip


Daniel in your sample try to move a scroll bar down and next click in maximize button, the explorer bar goes down. Is normal this behaviour or need some fix? Thanks in advance.
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: Explorer Bar Class Issues

Postby James Bott » Thu Aug 26, 2010 1:40 am

Wanderson,

I'm not sure what you mean. If you mean that the scrollbar disappears when you maximize the window, that is expected behavior in this case. When the taskpanels all fit within the Explorerbar then the scrollbar is not visible (since it is not needed). If you have more or longer taskpanels so that they will not fit within the window (maximized or not), then the scrollbar will be visible.

You can check this behavior using Windows Explorer.

If you meant something else, then please explain again.

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

Re: Explorer Bar Class Issues

Postby James Bott » Thu Aug 26, 2010 1:46 am

Daniel,

Thanks, Daniel, it is looking good!

One problem I had was when using it with a toolbar. Can you create a demo with a toolbar and a status bar perhaps?

If you like, I can do some testing here.

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

Re: Explorer Bar Class Issues

Postby Daniel Garcia-Gil » Thu Aug 26, 2010 2:25 am

James

Sure, write me to danielgarciagil@gmail.com
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Explorer Bar Class Issues

Postby Daniel Garcia-Gil » Thu Aug 26, 2010 10:25 am

James

it's the prg code

Sample in Left Side

Image


Sample in Right Side

Image


Code: Select all  Expand view  RUN

#include "FiveWin.ch"

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

function Main()

   local oWnd, oExBar, oPanel1, oPanel2, oPanel3, oPanel4
   local bClick := { | o | MsgInfo( o:GetText() ) }
   local oBar
     
   DEFINE WINDOW oWnd TITLE "FWH Class TExplorerBar"
   DEFINE BUTTONBAR oBar OF oWnd 2007
   
   oWnd:SetSize( 450, 300 )

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

   oPanel1 = oExBar:AddPanel( "One", "..\bitmaps\32x32\people.bmp" )
   oPanel1:lSpecial = .T.
   oPanel1:AddLink( "First item", bClick, "..\bitmaps\16x16\additem.bmp" )
   oPanel1:AddLink( "Second item", bClick, "..\bitmaps\16x16\copy.bmp" )
     
   oPanel2 = oExBar:AddPanel( "Two", "..\bitmaps\32x32\case.bmp" )
   oPanel2:AddLink( "First item", bClick, "..\bitmaps\16x16\adddbf.bmp" )
   oPanel2:AddLink( "Second item", bClick, "..\bitmaps\16x16\delete0.bmp" )
   oPanel2:AddLink( "Third item", bClick, "..\bitmaps\16x16\envelope.bmp" )
   oPanel2:AddLink( "Fourth item", bClick, "..\bitmaps\16x16\copy.bmp" )

   oPanel3 = oExBar:AddPanel( "Three", "..\bitmaps\32x32\graphics.bmp" )
   oPanel3:AddLink( "First item", bClick, "..\bitmaps\16x16\adddbf.bmp" )
   oPanel3:AddLink( "Second item", bClick, "..\bitmaps\16x16\delete0.bmp" )
   oPanel3:AddLink( "Third item", bClick, "..\bitmaps\16x16\envelope.bmp" )
   
   oPanel4 = oExBar:AddPanel( "Four" )
   oPanel4:AddLink( "First item", bClick, "..\bitmaps\16x16\additem.bmp" )
   oPanel4:AddLink( "Second item", bClick, "..\bitmaps\16x16\copy.bmp" )

   oWnd:oLeft = oExBar //  oWnd:oRight = oExBar <== change to switch side
   
   SET MESSAGE OF oWnd TO "FWH Class TExplorerBar demo" NOINSET CENTERED 2007

   ACTIVATE WINDOW oWnd

return nil
 
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 47 guests