Some more Tests with TExplorerBar() + new sample

Some more Tests with TExplorerBar() + new sample

Postby ukoenig » Thu Jul 10, 2008 11:17 am

Hello,

here are some undocumented methods i have tested.

Image

Code: Select all  Expand view  RUN

#include "fivewin.ch"

PROCEDURE Main()

LOCAL oWnd, oBar, oPanel
LOCAL bClick := {|o| MsgInfo( o:GetText() ) }
LOCAL oFont1, oBar1, oBtn1, oBtn2

//DEFINE FONT oFont1 NAME "Arial" SIZE 0,-20 BOLD
DEFINE FONT oFont1 NAME "Arial" SIZE 0,-13 BOLD
aRect3 := GetSysmetrics( 1 ) // Screen-Höhe
aRect4 := GetSysmetrics( 0 ) // Screen-Breite

IF MsgYesNo( "Explorer-Menü mit MDI-Fenster erzeugen ?", "Treffen Sie eine Auswahl" )
      DEFINE WINDOW oWnd ;
      FROM 0, 0 TO aRect3, aRect4 PIXEL;
      TITLE "Explorer-Bar mit MDI-Fenster" ;
      MDI
ELSE
      DEFINE WINDOW oWnd ;
      FROM 0, 0 TO aRect3, aRect4 PIXEL;
      TITLE "Explorer-Bar"
ENDIF

DEFINE BUTTONBAR oBar1 3DLOOK OF oWnd BUTTONSIZE 70,80 2007 RIGHT

DEFINE BUTTON oBtn1 OF oBar1 ACTION ( oBar:Collapse() )  ;
RESOURCE "info_5" PROMPT "Help for" + CRLF + "Visual Tools"   

DEFINE BUTTON oBtn2 OF oBar1 ACTION ( oBar:Expand() )  ;
RESOURCE "info_5" PROMPT "Help for" + CRLF + "Visual Tools"   

oBar := TExplorerBar():New()
oPanel1 := oBar:AddPanel("1. Menü" )
      oPanel1:lSpecial := .T.  // aktive Kopfleiste
      oPanel1:SetFont ( oFont1 )

      oPanel1:AddLink("1. Auswahl", bClick,"presentation")
      oPanel1:AddLink("2. Auswahl", bClick,"welt")
      oPanel1:AddLink("3. Auswahl", bClick,"drucker")
      oPanel1:AddLink("4. Auswahl", bClick,"copycd")
 
oPanel2 := oBar:AddPanel("2. Menü" )
      oPanel2:lSpecial := .T.
      oPanel2:SetFont ( oFont1 )

      oPanel2:AddLink("1. Auswahl", bClick,"eingfolder")
      oPanel2:AddLink("2. Auswahl", bClick,"Bildschirm")
      oPanel2:AddLink("3. Auswahl", bClick,"Service")
      oPanel2:Disable()
      //oPanel:Collapse()
      //oPanel:Hide()

oPanel3 := oBar:AddPanel("3. Menü" )
      oPanel3:SetFont ( oFont1 )

      oPanel3:AddLink("1. Auswahl", bClick,"folderimg")
      oPanel3:AddLink("2. Auswahl", bClick,"folder")
      oPanel3:AddLink("3. Auswahl", bClick,"computer")
   
oPanel4 := oBar:AddPanel("4. Menü" )
      oPanel4:SetFont ( oFont1 )

     oPanel4:AddLink( "Ende", { || Ende() },"public" )

oPanel5 := oBar:AddPanel("Toggle 2. Menü" )
      oPanel5:SetFont ( oFont1 )

      oPanel5:AddLink("2. Menü < DISABLE >", ;
      { || ( oPanel2:Disable(), ;
              oBar:Refresh() ) }  ,"folderimg")
      oPanel5:AddLink("2. Menü < ENABLE >", ;
     { || ( oPanel2:Enable(), ;
             oBar:Refresh() ) },"folder")
      oPanel5:AddLink("2. Menü < HIDE >", ;
     { || ( oPanel2:Collapse(), ;
              oPanel2:Hide(), ; 
              oBar:Refresh() ) }, "computer")
      oPanel5:AddLink("2. Menü < SHOW >", ;
      { || ( oPanel2:Expand(), ;
              oPanel2:Show(), ;
              oBar:Refresh() ) },"folderimg")

oPanel6 := oBar:AddPanel("Informationen" )
      oPanel6:SetFont ( oFont1 )

oPanel6:cHtmlText :=  "<b>TExplorerBar()</b><br>" +;
                        "<br size=5>" +;
                        "Explorer-Bar-Klasse<br>"+;
                        "im Windows XP-Style<br>" +;
                        "<br>" +;
                        "<b>Autor</b><br>" +;
                        "<br size=5>" +;
                        "Uwe König<br>"+;
                        "E-Mail : www.esckoenig@aol.com"

   /*
      <!-- cHtmlText --!>
     
      Support :
      <b></b>
      <i></i>
      <u></u>
      <br>
     
      Font "tahoma" 0,-11
   */

ACTIVATE WINDOW oWnd

RETURN NIL

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

FUNCTION ENDE()

IF MsgYesNo( "Das Programm beenden ?", "ACHTUNG" )
   QUIT
ENDIF

RETURN( NIL )



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

Postby James Bott » Thu Jul 10, 2008 3:31 pm

Uwe,

I had found Hide() and Show() before, but I didn't mention them because they don't seem very useful. The problem is that when an Expando is hidden, the Explorerbar has a big blank spot in it which doesn't have a good visual appearance. It does look OK for the last Expando however.

I would be careful how I used Disable(). It is useful when the Expando is not relavent to the current screen, but I would not use it to disable features not available to the current user. I would just not show the Expando in the latter case.

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 69 guests