Click on Xbrowse with oTree menu

Click on Xbrowse with oTree menu

Postby dutch » Sun Sep 15, 2013 1: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,
Image


Code: Select all  Expand view
#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 19.01 / 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)
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: Click on Xbrowse with oTree menu

Postby nageswaragunupudi » Sun Sep 15, 2013 7: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
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 95 guests