FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Click on Xbrowse with oTree menu
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Click on Xbrowse with oTree menu
Posted: Sun Sep 15, 2013 01:00 AM
Dear All,

I would like to create menu as Samples\Metro2.prg with submenu. Where can I set :OnClicked? I try with ::Cargo but don't successful.

Thanks in advance,



Code (fw): Select all Collapse
#include "FiveWin.ch"
#include "xbrowse.ch"

*---------------*
function SpcWnd()

   local oWnds, oFont, oBrw, oFont2, oFont3, oTree

    oTree := BuildMenu()

   DEFINE FONT oFont NAME "Segoe UI Light" SIZE 0, -52    

   DEFINE FONT oFont2 NAME "Segoe UI Light" SIZE 0, -24     // -32

   DEFINE FONT oFont3 NAME "Segoe UI Light" SIZE 0, -16    

   DEFINE WINDOW oWnds STYLE nOr( WS_POPUP, WS_VISIBLE ) ;
      COLOR CLR_BLACK, CLR_WHITE 
      
   @ 1,     7 SAY "Control Panel" FONT oFont SIZE 300, 100
   
//   @ 1, 70 SAY "" FONT oFont SIZE 300, 100
      
   @ 7,     5 XBROWSE oBrw DATASOURCE oTree COLSIZES 500 CELL ;
      FONT oFont2 SIZE 250, 700 NOBORDER OF oWnds

   oBrw:nDataLines = 1
   oBrw:lRecordSelector = .F.
   oBrw:lHeader   = .F.
   oBrw:lHScroll  = .F.
   oBrw:lVScroll  = .F.
   oBrw:nStretchCol = 1
   oBrw:bClrStd = { || { CLR_BLACK, CLR_WHITE } } // RGB( 170, 170, 170 ) 
   oBrw:bClrSelFocus = { || { CLR_WHITE, RGB( 34, 177, 76 ) } }
   oBrw:SetColor( "B/W*" )
   
   oBrw:CreateFromCode()
//  oBrw:aCols[ 1 ]:bPaintText = { | oCol, hDC, cText, aCoors, aColors, lHighlight | DrawRow( oCol, hDC, cText, aCoors, oFont3 )  }
   oBrw:SetFocus()
   
   ACTIVATE WINDOW oWnds MAXIMIZED ;
      ON CLICK ( oWnds:End() )
      
return nil         

*---------------------------*
static function BuildMenu()
local oTree, cDate, n, x, y
local lAddTree
local aItems := {   { "Profile", {'Guest','Company','Member','Reservation','Promote'} }, ;
                    { 'Customer Relation Manangement' , {'Email Advertising','Email Birthday','SMS Email','SMS Birthday'} }, ;
                        { 'Sold Out Items', {'Sold Out Items','Non Sale Items'} }, ;
                        { 'Set Up', {{'Outlet','Outlet','Station','Table'},{'Menu Items','Short-Cut','Group Items'},'Miscellaneous','Print Format','Close Day','User Login','Tax Rate','Main Data'} }, ; 
                        { 'Tax Invoice', {'Issue Tax Invoice','Edit Tax Invoice'} }, ; 
                        { 'Report', {'Cashier Report','Setup Report','Close Day Report'} }, ; 
                        { 'Maintenance', {'File Maintenance','Reset User','Restore Last Backup'} } }
   
    
   TREE oTree
        for n:=1 to len(aItems)
      _TreeItem( aItems[n][1] )
            TREE
        for x := 1 to len(aItems[n][2])
          _TreeItem( aItems[n][2][x] )
          lAddTree := .F.
          if len( aItems[n][2][x] ) > 1
            lAddTree := .T.
            TREE
          end
          if len( aItems[n][2][x] ) > 1
            for y := 2 to len(aItems[n][2][x])
                 _TreeItem( aItems[n][2][x][y] ):Cargo := {|| ConOutlet() }
            next
          end
          if lAddTree
            ENDTREE
          else
          end
            next
            ENDTREE        
    next
   ENDTREE
return oTree
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Click on Xbrowse with oTree menu
Posted: Sun Sep 15, 2013 07:46 AM

Double Click toggles open/close of subtree
This is automatically set by xbrwose when we browse a tree

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion