To Antonio and all Simply Test ExplorerBar RESOLVED!

To Antonio and all Simply Test ExplorerBar RESOLVED!

Postby Silvio » Thu Aug 19, 2010 4:37 pm

try this sample test please

I used customer.dbf and Test.dbf you can found on fwh\samples


Code: Select all  Expand view

#include "FiveWin.ch"
#include "XBrowse.ch"
#include "Splitter.ch"



// Purpose: Showing two xbrowse with a Horizontal splitter in a dialog,
//          an explorerbar at Right , on the first xbrowse there is a tab
// Author : Silvio falconi
// Date   : 19.08.2010



STATIC  oWnd,oBar,oDlg ,oSplit2,oSplit,oExBar

function Main()


   DEFINE WINDOW oWnd TITLE "Simply Test ExplorerBar  two browse, tab, and splitters"  ;
      MENU BuildMenu()

    DEFINE BUTTONBAR oBar _3D SIZE 44, 46 OF oWnd 2007

   oWnd:bResized := {|| ResizeWndMain() }

   ACTIVATE WINDOW oWnd maximized on init Test()

return nil




function BuildMenu()

   local oMenu

   MENU oMenu  2007
      MENUITEM "Test"
      MENU
         MENUITEM "Go Test "
      ENDMENU
      oMenu:AddMdi()
   ENDMENU

   return oMenu




function test()
Local oDlg
Local oGrid2
Local oGrid3
Local nSplit :=220
local aClient

lOCAL nGridBottom,nGridRight

local oTab



// create the dialog into oWnd
 aClient := GetClientRect (oWnd:hWnd )


 DEFINE DIALOG oDlg

  oDlg:nTop    = oBar:nHeight-1
  oDlg:nLeft   = 0
  oDlg:nBottom = aClient[3] - 1
  oDlg:nRight  = aClient[4]
  oDlg:nStyle  = nOR( WS_CHILD, 4 )
  nGridBottom := (oDlg:nBottom / 2) - oBar:nHeight
  nGridRight  := (oDlg:nRight / 2 )
   // oWnd:oClient := oDlg



  @0,0 EXPLORERBAR oExBar of  oDlg  SIZE nSplit-2, oDlg:nBottom


// open first xbrowse


  SELECT 1

   USE Customer ALIAS CU



   oGrid2 := TXBrowse():New( oDlg )
   oGrid2:nTop    := 00
   oGrid2:nLeft   := nSplit+2
   oGrid2:nBottom := 200
   oGrid2:nRight  := nGridRight



   oCol = oGrid2:AddCol()
   oCol:bStrData = { || CU->First }
   oCol:cHeader = "First"




   oGrid2:cAlias :=CU->(Alias())
   oGrid2:SetRDD()
   oGrid2:CreateFromCode()



   //create the Tabs

     @  oGrid2:nBottom, oGrid2:nLeft TABS oTab ;
     OPTION 1 SIZE oWnd:nWidth()-80, 12 PIXEL OF oDlg ;
     ITEMS ' First ', ' Last ';
     ACTION ( nOrder := oTab:nOption  ,;
              CU->(DbSetOrder(nOrder)),;
              CU->(DbGoTop())         ,;
              oGrid2:Refresh(.t.)    )







   // open second xbrowse


SELECT 2
USE TEST ALIAS TEST

   oGrid3 := TXBrowse():New( oDlg )
  // oGrid3:nTop    :=   oGrid2:nBottom+5
   oGrid3:nTop    :=   oTab:nbottom+5
   oGrid3:nLeft   :=   nSplit+2
   oGrid3:nBottom :=    nGridBottom
   oGrid3:nRight  :=   nGridRight

   oGrid3:cAlias :=TEST->(Alias())
   oGrid3:SetRDD()
   oGrid3:CreateFromCode()









//First splitter

  @ oTab:nbottom+2, nSplit SPLITTER oSplit2 ;
                 HORIZONTAL  ;
                  COLOR CLR_RED ;
                   PREVIOUS CONTROLS oGrid2,oTab ;
                   HINDS CONTROLS oGrid3 ;
                    SIZE  oGrid3:nRight, 2 PIXEL ;
                   OF oDlg ;
                   _3DLOOK ;
                 UPDATE





// second  Splitter

   @ 00, nSplit SPLITTER oSplit ;
      VERTICAL ;
       COLOR CLR_BLUE ;
      PREVIOUS CONTROLS oExBar;
      HINDS CONTROLS oGrid2, oGrid3, oSplit2,oTab;
      SIZE 1, nGridBottom PIXEL ;
      OF oDlg ;
      _3DLOOK ;
      UPDATE




   ACTIVATE DIALOG oDlg NOWAIT;
   ON INIT ExplBarInit( oExBar ) ;
  ON PAINT oSplit:AdjClient()



return nil






Function ResizeWndMain()
   local aClient
   if oDlg != NIL
      aClient := GetClientRect (oWnd:hWnd )
      oDlg:SetSize( aClient[4], aClient[3] - oWnd:oBar:nHeight - oWnd:oMsgBar:nHeight )
      // oApp():oDlg:Move(oApp():oDlg:nYMove,)
      oDlg:Refresh()
      SysRefresh()
   endif
return NIL






function ExplBarInit( oExBar )

   local oPanel1, oPanel2, oPanel3, oPanel4
   local bClick := { | o | MsgInfo( o:GetText() ) }

   oPanel1 = oExBar:AddPanel( "One", "people" )
   oPanel1:lSpecial = .T.
   oPanel1:AddLink( "First item", bClick, "additem" )
   oPanel1:AddLink( "Second item", bClick, "copy" )
     
   oPanel2 = oExBar:AddPanel( "Two", "case" )
   oPanel2:AddLink( "First item", bClick, "adddbf" )
   oPanel2:AddLink( "Second item", bClick, "delete" )
   oPanel2:AddLink( "Third item", bClick, "envelope" )
   oPanel2:AddLink( "Fourth item", bClick, "envelope" )

   oPanel3 = oExBar:AddPanel( "Three", "graphics" )
   oPanel3:AddLink( "First item", bClick, "adddbf" )
   
   oPanel4 = oExBar:AddPanel( "Four" )
   oPanel4:AddLink( "First item", bClick, "copy" )
   oPanel4:AddLink( "Second item", bClick, "additem" )

return nil
 



the problem is : the horizontal splitter run bad because when I move it the tab control ( it is on down the first xbrowse) become bigger and the I cannot move the Horizontal splitter






Image
Last edited by Silvio on Fri Aug 20, 2010 1:25 am, edited 1 time in total.
Best Regards, Saludos

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

Re: To Antonio and all Simply Test ExplorerBar two browse, tab

Postby Daniel Garcia-Gil » Thu Aug 19, 2010 5:38 pm

Silvio...

i explained you yesterday by chat...

leave here a simple test... working

http://www.sitasoft.net/fivewin/samples/spli.zip

Image

Code: Select all  Expand view

#include "fivewin.ch"
#include "Splitter.ch"

REQUEST DBFCDX

FUNCTION Main()
   LOCAL oSample

   oSample = TSample():New()
     
RETURN NIL

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

CLASS TSample

  DATA oWnd
  DATA oTaskpanel
  DATA oSplitV
  DATA oSplitH
  DATA oGrid
  DATA oTab
 
  DATA oPanelLeft
  DATA oPanelTop
  DATA oPanelDown
 
  METHOD New()
 
  METHOD BuildGrid()
  METHOD BuildPanel()
  METHOD BuildSplitterH()
  METHOD BuildSplitterV()
  METHOD Buildtab()
  METHOD OnResizeWnd( nWidth, nHeight )
 
ENDCLASS

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

METHOD New() CLASS TSample

   LOCAL oBrush

   DEFINE BRUSH oBrush COLOR CLR_CYAN

   DEFINE WINDOW ::oWnd

   ::oPanelLeft = TPanel():New( 0, 0, 150, 150, ::oWnd )  
   ::oPanelTop  = TPanel():New( 0, ::oPanelLeft:nRight + 5, ::oWnd:nHeight, ::oWnd:nWidth, ::oWnd )  
   ::oPanelDown = TPanel():New( ::oPanelTop:nHeight + 5, ;
                                ::oPanelLeft:nRight + 5, ;
                                ::oWnd:nHeight - ::oPanelTop:nHeight - 5, ;
                                ::oWnd:nWidth, ::oWnd )  
   ::BuildPanel()
   ::BuildGrid()
   ::BuildTab()
   ::BuildSplitterH()
   ::BuildSplitterV()

   ::oPanelDown:SetBrush( oBrush )
   ::oWnd:bResized = {| nType, nWidth, nHeight | ::OnResizeWnd( nWidth, nHeight ) }
   
   ACTIVATE WINDOW ::oWnd

RETURN Self

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

METHOD BuildGrid() CLASS TSample

   LOCAL i, aBrowse, oCol

   USE "customer" ALIAS CU NEW SHARED

   ::oGrid := TXBrowse():New( ::oPanelTop )
   ::oGrid:nTop    := 0
   ::oGrid:nLeft   := 0
   ::oGrid:nBottom := ::oWnd:nHeight
   ::oGrid:nRight  := ::oWnd:nWidth

   aBrowse   := { { { || CU->FIRST }, i18n("First"), 150, 0 },;
                  { { || CU->LAST  }, i18n("Last"), 150, 0 },;
                  { { || CU->STREET}, i18n("Street"), 150, 0 },;
                  { { || CU->CITY } , i18n("City"), 150, 0 } }

   FOR i := 1 TO Len(aBrowse)
      oCol := ::oGrid:AddCol()
      oCol:bStrData := aBrowse[ i, 1 ]
      oCol:cHeader  := aBrowse[ i, 2 ]
      oCol:nWidth   := aBrowse[ i, 3 ]
      oCol:nDataStrAlign := aBrowse[ i, 4 ]
      oCol:nHeadStrAlign := aBrowse[ i, 4 ]
   NEXT
 
   ::oGrid:SetRDD()
   ::oGrid:CreateFromCode()
   
   ::oPanelTop:oClient = ::oGrid


RETURN NIL


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

METHOD BuildPanel() CLASS TSample

   LOCAL oPanel1
   lOCAL bClick:={|| msgInfo( "clicked") }

   ::oTaskPanel := TExplorerBar():New( 0, 0, 150, 150, ::oPanelLeft )
   oPanel1 = ::oTaskPanel: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" )
   ::oPanelLeft:oClient = ::oTaskPanel
       
RETURN NIL

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

METHOD BuildSplitterV() CLASS TSample
   
   @ 00, ::oTaskPanel:nWidth + 1 SPLITTER ::oSplitV ;
         VERTICAL ;
         COLOR CLR_YELLOW ;
         PREVIOUS CONTROLS ::oPanelLeft ;
         HINDS CONTROLS ::oPanelTop, ::oPanelDown, ::oSplitH;
         SIZE 2, ::oWnd:nHeight PIXEL  ;
         LEFT MARGIN 70           ;
         RIGHT MARGIN 200         ;
         OF ::oWnd ;
         UPDATE
     
RETURN NIL

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

METHOD BuildSplitterH() CLASS TSample
   
   @ ::oGrid:nHeight + 1, ::oTaskPanel:nWidth + 1 SPLITTER ::oSplitH ;
         HORIZONTAL ;
         COLOR CLR_YELLOW ;
         PREVIOUS CONTROLS ::oPanelTop ;
         HINDS CONTROLS ::oPanelDown;
         SIZE ::oWnd:nWidth, 2 PIXEL  ;
         TOP MARGIN 120           ;
         BOTTOM MARGIN 120  ;
         OF ::oWnd ;
         UPDATE
     
RETURN NIL

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

METHOD Buildtab() CLASS TSample

   LOCAL oSelf := Self

   @ ::oGrid:nBottom + 2, 0 TABS ::oTab SIZE ::oPanelTop:nWidth, 12 PIXEL OF ::oPanelTop ;
     ITEMS ' First ', ' Last ';
     ACTION ( CU->( DbSetOrder( ::oTab:nOption ) ),;
              CU->( DbGoTop() ) ,;
              oSelf:oGrid:Refresh( .T. ) )
             
   ::oPanelTop:oBottom = ::oTab              

RETURN NIL
//--------------------

METHOD OnResizeWnd( nWidth, nHeight )

   IF nWidth != NIL  .AND. nHeight != NIL
   
      ::oPanelLeft:SetSize( ::oPanelLeft:nWidth, nHeight )
      ::oSplitV:SetSize( ::oSplitV:nWidth, nHeight )
      ::oSplitV:nLong = nHeight
      ::oPanelTop:SetSize( nWidth - ::oPanelLeft:nWidth - ::oSplitV:nWidth, ::oPanelTop:nHeight )
      ::oSplitH:SetSize( nWidth, 2 )
      ::oSplitH:nLong = nWidth
      ::oPanelDown:SetSize( nWidth - ::oPanelLeft:nWidth - ::oSplitV:nWidth, nHeight - ::oPanelDown:nTop )
   
   ENDIF

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

Re: To Antonio and all Simply Test ExplorerBar two browse, tab

Postby Silvio » Thu Aug 19, 2010 5:41 pm

ok this in a Window ...I understood What you sad on chat

But I'm thinking ... the dialog is From Twindow Class
If you Know How resolve it on a Window You Know How Resolve it on a Dialog...

and then I not understood why if I ask to resolve it on a Dialog Why U and All let me sad to resolve it on Window

On past there is one man ( now also alive) not Know How resolve mine problems and allways he thinked How around the problem to propose another solution ....

I use a Dialog ( Nor. 4 style ) on a Window no MDi not a window ... I explained you the problem yesterday at chat

If I cannot create it , NO PROBLEM !!!

On past When the problem is not Of Community , I cannot resolve the problem,... I must only wait when someone of You has the same problem
Best Regards, Saludos

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

Re: To Antonio and all Simply Test ExplorerBar two browse, tab

Postby Daniel Garcia-Gil » Thu Aug 19, 2010 5:57 pm

Silvio

absolutely same

this samples is with dialog now... (windows, dialogs and panels)

http://www.sitasoft.net/fivewin/samples/spli2_1.zip

Code: Select all  Expand view

#include "fivewin.ch"
#include "Splitter.ch"

REQUEST DBFCDX

FUNCTION Main()
   LOCAL oSample

   oSample = TSample():New()
     
RETURN NIL

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

CLASS TSample

  DATA oWnd
  DATA oTaskpanel
  DATA oSplitV
  DATA oSplitH
  DATA oGrid
  DATA oTab
 
  DATA oPanelLeft
  DATA oPanelTop
  DATA oPanelDown
 
  METHOD New()
 
  METHOD BuildGrid()
  METHOD BuildPanel()
  METHOD BuildSplitterH()
  METHOD BuildSplitterV()
  METHOD Buildtab()
  METHOD OnResizeWnd( nWidth, nHeight )
 
ENDCLASS

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

METHOD New() CLASS TSample

   LOCAL oBrush
   LOCAL oSelf := Self

   DEFINE BRUSH oBrush COLOR CLR_CYAN

   DEFINE WINDOW ::oWnd

   DEFINE DIALOG ::oPanelLeft STYLE nOr( WS_CHILD ) SIZE 150, 150 OF ::oWnd
   ACTIVATE DIALOG ::oPanelLeft NOWAIT
   
   DEFINE DIALOG ::oPanelTop STYLE nOr( WS_CHILD ) SIZE 150, 150 OF ::oWnd
   ACTIVATE DIALOG ::oPanelTop NOWAIT ;
   ON INIT ::Move( 0, oSelf:oPanelLeft:nRight + 5, oSelf:oWnd:nHeight / 2, oSelf:oWnd:nWidth )

   ::oPanelDown = TPanel():New( ::oPanelTop:nHeight + 5, ;
                                ::oPanelLeft:nRight + 5, ;
                                ::oWnd:nHeight - ::oPanelTop:nHeight - 5, ;
                                ::oWnd:nWidth, ::oWnd )  
                               
   ::BuildPanel()
   ::BuildGrid()
   ::BuildTab()
   ::BuildSplitterH()
   ::BuildSplitterV()

   ::oPanelDown:SetBrush( oBrush )
   ::oWnd:bResized = {| nType, nWidth, nHeight | ::OnResizeWnd( nWidth, nHeight ) }
   
   ACTIVATE WINDOW ::oWnd

RETURN Self

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

METHOD BuildGrid() CLASS TSample

   LOCAL i, aBrowse, oCol

   USE "customer" ALIAS CU NEW SHARED

   ::oGrid := TXBrowse():New( ::oPanelTop )
   ::oGrid:nTop    := 0
   ::oGrid:nLeft   := 0
   ::oGrid:nBottom := ::oWnd:nHeight
   ::oGrid:nRight  := ::oWnd:nWidth

   aBrowse   := { { { || CU->FIRST }, i18n("First"), 150, 0 },;
                  { { || CU->LAST  }, i18n("Last"), 150, 0 },;
                  { { || CU->STREET}, i18n("Street"), 150, 0 },;
                  { { || CU->CITY } , i18n("City"), 150, 0 } }

   FOR i := 1 TO Len(aBrowse)
      oCol := ::oGrid:AddCol()
      oCol:bStrData := aBrowse[ i, 1 ]
      oCol:cHeader  := aBrowse[ i, 2 ]
      oCol:nWidth   := aBrowse[ i, 3 ]
      oCol:nDataStrAlign := aBrowse[ i, 4 ]
      oCol:nHeadStrAlign := aBrowse[ i, 4 ]
   NEXT
 
   ::oGrid:SetRDD()
   ::oGrid:CreateFromCode()
   
   ::oPanelTop:oClient = ::oGrid


RETURN NIL


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

METHOD BuildPanel() CLASS TSample

   LOCAL oPanel1
   lOCAL bClick:={|| msgInfo( "clicked") }

   ::oTaskPanel := TExplorerBar():New( 0, 0, 150, 150, ::oPanelLeft )
   oPanel1 = ::oTaskPanel: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" )
   ::oPanelLeft:oClient = ::oTaskPanel
       
RETURN NIL

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

METHOD BuildSplitterV() CLASS TSample
   
   @ 00, ::oTaskPanel:nWidth + 1 SPLITTER ::oSplitV ;
         VERTICAL ;
         COLOR CLR_YELLOW ;
         PREVIOUS CONTROLS ::oPanelLeft ;
         HINDS CONTROLS ::oPanelTop, ::oPanelDown, ::oSplitH;
         SIZE 2, ::oWnd:nHeight PIXEL  ;
         LEFT MARGIN 70           ;
         RIGHT MARGIN 200         ;
         OF ::oWnd ;
         UPDATE
     
RETURN NIL

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

METHOD BuildSplitterH() CLASS TSample
   
   @ ::oPanelTop:nHeight + 1, ::oTaskPanel:nWidth + 1 SPLITTER ::oSplitH ;
         HORIZONTAL ;
         COLOR CLR_YELLOW ;
         PREVIOUS CONTROLS ::oPanelTop ;
         HINDS CONTROLS ::oPanelDown;
         SIZE ::oWnd:nWidth, 2 PIXEL  ;
         TOP MARGIN 120           ;
         BOTTOM MARGIN 120  ;
         OF ::oWnd ;
         UPDATE
     
RETURN NIL

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

METHOD Buildtab() CLASS TSample

   LOCAL oSelf := Self

   @ ::oGrid:nBottom + 2, 0 TABS ::oTab SIZE ::oPanelTop:nWidth, 12 PIXEL OF ::oPanelTop ;
     ITEMS ' First ', ' Last ';
     ACTION ( CU->( DbSetOrder( ::oTab:nOption ) ),;
              CU->( DbGoTop() ) ,;
              oSelf:oGrid:Refresh( .T. ) )
             
   ::oPanelTop:oBottom = ::oTab              

RETURN NIL
//--------------------

METHOD OnResizeWnd( nWidth, nHeight )

   IF nWidth != NIL  .AND. nHeight != NIL
   
      ::oPanelLeft:SetSize( ::oPanelLeft:nWidth, nHeight )
      ::oSplitV:SetSize( ::oSplitV:nWidth, nHeight )
      ::oSplitV:nLong = nHeight
      ::oPanelTop:SetSize( nWidth - ::oPanelLeft:nWidth - ::oSplitV:nWidth, ::oPanelTop:nHeight )
      ::oSplitH:SetSize( nWidth, 2 )
      ::oSplitH:nLong = nWidth
      ::oPanelDown:SetSize( nWidth - ::oPanelLeft:nWidth - ::oSplitV:nWidth, nHeight - ::oPanelDown:nTop )
   
   ENDIF

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

Re: To Antonio and all Simply Test ExplorerBar two browse, tab

Postby James Bott » Thu Aug 19, 2010 6:04 pm

Daniel,

I previously had tried what you have done by putting the Explorer bar on a panel. This does force the scrollbar to be in the correct position, but the scrollbar doesn't work correctly. It is always visible instead of only being visible if there is something off the bottom of the window that could be scrolled.

As I discuss in another current thread on this topic I believe the explorer bar needs to be modified so that the scollbar is built into the control. See this thread for details:

viewtopic.php?f=3&t=19614

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

Re: To Antonio and all Simply Test ExplorerBar two browse, tab

Postby James Bott » Thu Aug 19, 2010 6:12 pm

Silvio,

As I have pointed out previously, you gain nothing by adding a dialog to the program. It just makes it more complex without adding a benefit.

I understand that you found that somehow it helped you fix a problem with "alias not found" errors, but this was an accidental discovery. You already had a program bug and this can easily be fixed without using a dialog.

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

Re: To Antonio and all Simply Test ExplorerBar two browse, tab

Postby Silvio » Thu Aug 19, 2010 7:33 pm

James ,
You can think how you want withn this methos i not lose customers

I make an simply prg with a window

DEFINE WINDOW ::oWndMain


ACTIVATE WINDOW ::oWndMain


on button bar I click on CUSTOMER()


SELECT CU
oApp():oDlg := TFsdi():New(oApp():oWndMain) Create a DIALOG ( WS_CHILD or NOR 4 STYLE )
oApp():oDlg:cTitle := i18n('Gestión de clientes')
oApp():oWndMain:oClient := oApp():oDlg
oApp():oDlg:NewGrid( nSplit ) create a xbrowse

can i create an explorerbar
can I create a tabs on down the xbrowse

It run ok

I can create customers(), articles(), Orders(), Sales(),

I can create also GRAPH CLASS INSTEAD of Xbrowse

and it run ok

and now I not lose customers....


Many years ago when there was the newgrouo I had the problem " ALIAS DON'T EXIST" and none help me

Now I use a system on MDI solution ( Mr Alfredo Arteaga propose) and it run good and it run ok also on this new method ( ws_child or nor 4 style dialog) .

the problem not is the " ALIAS DON'T EXIST" the problem is another .. my problem is not of Community problem .....


As I allready wrote If I cannot create it NO PROBLEM !
Best Regards, Saludos

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

Re: To Antonio and all Simply Test ExplorerBar two browse, tab

Postby Silvio » Thu Aug 19, 2010 7:44 pm

BUT THERE is SOMETHING I NOT UNDERSTOOD


GO ON MY TEST SAMPLE AND REM THE TAB CONTROL

or compile this
Code: Select all  Expand view

#include "FiveWin.ch"
#include "XBrowse.ch"
#include "Splitter.ch"



// Purpose: Showing two xbrowse with a Horizontal splitter in a dialog,
//          an explorerbar at Right , on the first xbrowse there is a tab
// Author : Silvio falconi
// Date   : 19.08.2010



STATIC  oWnd,oBar,oDlg ,oSplit2,oSplit,oExBar

function Main()


   DEFINE WINDOW oWnd TITLE "Simply Test ExplorerBar  two browse, tab, and splitters"  ;
      MENU BuildMenu()

    DEFINE BUTTONBAR oBar _3D SIZE 44, 46 OF oWnd 2007

   oWnd:bResized := {|| ResizeWndMain() }

   ACTIVATE WINDOW oWnd maximized on init Test()

return nil




function BuildMenu()

   local oMenu

   MENU oMenu  2007
      MENUITEM "Test"
      MENU
         MENUITEM "Go Test "
      ENDMENU
      oMenu:AddMdi()
   ENDMENU

   return oMenu




function test()
Local oDlg
Local oGrid2
Local oGrid3
Local nSplit :=220
local aClient

lOCAL nGridBottom,nGridRight

local oTab



// create the dialog into oWnd
 aClient := GetClientRect (oWnd:hWnd )


 DEFINE DIALOG oDlg

  oDlg:nTop    = oBar:nHeight-1
  oDlg:nLeft   = 0
  oDlg:nBottom = aClient[3] - 1
  oDlg:nRight  = aClient[4]
  oDlg:nStyle  = nOR( WS_CHILD, 4 )
  nGridBottom := (oDlg:nBottom / 2) - oBar:nHeight
  nGridRight  := (oDlg:nRight / 2 )
   // oWnd:oClient := oDlg



  @0,0 EXPLORERBAR oExBar of  oDlg  SIZE nSplit-2, oDlg:nBottom


// open first xbrowse


  SELECT 1

   USE Customer ALIAS CU



   oGrid2 := TXBrowse():New( oDlg )
   oGrid2:nTop    := 00
   oGrid2:nLeft   := nSplit+2
   oGrid2:nBottom := 200
   oGrid2:nRight  := nGridRight



   oCol = oGrid2:AddCol()
   oCol:bStrData = { || CU->First }
   oCol:cHeader = "First"




   oGrid2:cAlias :=CU->(Alias())
   oGrid2:SetRDD()
   oGrid2:CreateFromCode()



   //create the Tabs
 /*
     @  oGrid2:nBottom, oGrid2:nLeft TABS oTab ;
     OPTION 1 SIZE oWnd:nWidth()-80, 12 PIXEL OF oDlg ;
     ITEMS ' First ', ' Last ';
     ACTION ( nOrder := oTab:nOption  ,;
              CU->(DbSetOrder(nOrder)),;
              CU->(DbGoTop())         ,;
              oGrid2:Refresh(.t.)    )
        */







   // open second xbrowse


SELECT 2
USE TEST ALIAS TEST

   oGrid3 := TXBrowse():New( oDlg )
   oGrid3:nTop    :=   oGrid2:nBottom+5
  // oGrid3:nTop    :=   oTab:nbottom+5
   oGrid3:nLeft   :=   nSplit+2
   oGrid3:nBottom :=    nGridBottom
   oGrid3:nRight  :=   nGridRight

   oGrid3:cAlias :=TEST->(Alias())
   oGrid3:SetRDD()
   oGrid3:CreateFromCode()









//First splitter

  @ oGrid2:nBottom+2, nSplit SPLITTER oSplit2 ;
                 HORIZONTAL  ;
                  COLOR CLR_RED ;
                   PREVIOUS CONTROLS oGrid2 ;
                   HINDS CONTROLS oGrid3 ;
                    SIZE  oGrid3:nRight, 2 PIXEL ;
                   OF oDlg ;
                   _3DLOOK ;
                 UPDATE





// second  Splitter

   @ 00, nSplit SPLITTER oSplit ;
      VERTICAL ;
       COLOR CLR_BLUE ;
      PREVIOUS CONTROLS oExBar;
      HINDS CONTROLS oGrid2, oGrid3, oSplit2;
      SIZE 1, nGridBottom PIXEL ;
      OF oDlg ;
      _3DLOOK ;
      UPDATE




   ACTIVATE DIALOG oDlg NOWAIT;
   ON INIT ExplBarInit( oExBar ) ;
  ON PAINT oSplit:AdjClient()



return nil






Function ResizeWndMain()
   local aClient
   if oDlg != NIL
      aClient := GetClientRect (oWnd:hWnd )
      oDlg:SetSize( aClient[4], aClient[3] - oWnd:oBar:nHeight - oWnd:oMsgBar:nHeight )
      // oApp():oDlg:Move(oApp():oDlg:nYMove,)
      oDlg:Refresh()
      SysRefresh()
   endif
return NIL






function ExplBarInit( oExBar )

   local oPanel1, oPanel2, oPanel3, oPanel4
   local bClick := { | o | MsgInfo( o:GetText() ) }

   oPanel1 = oExBar:AddPanel( "One", "people" )
   oPanel1:lSpecial = .T.
   oPanel1:AddLink( "First item", bClick, "additem" )
   oPanel1:AddLink( "Second item", bClick, "copy" )

   oPanel2 = oExBar:AddPanel( "Two", "case" )
   oPanel2:AddLink( "First item", bClick, "adddbf" )
   oPanel2:AddLink( "Second item", bClick, "delete" )
   oPanel2:AddLink( "Third item", bClick, "envelope" )
   oPanel2:AddLink( "Fourth item", bClick, "envelope" )

   oPanel3 = oExBar:AddPanel( "Three", "graphics" )
   oPanel3:AddLink( "First item", bClick, "adddbf" )

   oPanel4 = oExBar:AddPanel( "Four" )
   oPanel4:AddLink( "First item", bClick, "copy" )
   oPanel4:AddLink( "Second item", bClick, "additem" )

return nil
























 


it run ok the horizontal splitter run ok but often the tabs control

How YOU explain it ?
Best Regards, Saludos

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

Re: To Antonio and all Simply Test ExplorerBar two browse, tab

Postby Silvio » Thu Aug 19, 2010 9:52 pm

Now I made a test with my system and with some helps of test of Daniel I resolved it
Thank to Daniel and James


Image
Best Regards, Saludos

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

Re: To Antonio and all Simply Test ExplorerBar RESOLVED!

Postby Otto » Fri Aug 20, 2010 11:37 am

Dear Silvio,

It is so kind of you that you always ask for help and then never post what you find out.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6330
Joined: Fri Oct 07, 2005 7:07 pm

Re: To Antonio and all Simply Test ExplorerBar RESOLVED!

Postby Uwe.Diemer » Fri Aug 20, 2010 1:58 pm

Ja so is er halt

Why Silvio are u using the computer of Mda Solution

A good "Friend" of you ?
User avatar
Uwe.Diemer
 
Posts: 98
Joined: Mon Aug 09, 2010 11:00 am

Re: To Antonio and all Simply Test ExplorerBar RESOLVED!

Postby Armando » Fri Aug 20, 2010 2:05 pm

Friends:

As usualy !.

Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3217
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: To Antonio and all Simply Test ExplorerBar RESOLVED!

Postby Silvio » Fri Aug 20, 2010 3:26 pm

Uwe,

I 'm working for Mda Solution , It is' a criminal offense ?

Antonio Know this situation .


Otto,

I made the same of Daniel sources ( with 3 panels second solution ) ,

I must re pubblish the sources ?
Best Regards, Saludos

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

Re: To Antonio and all Simply Test ExplorerBar RESOLVED!

Postby Uwe.Diemer » Fri Aug 20, 2010 3:31 pm

I have glasses i can read without Bold Font
User avatar
Uwe.Diemer
 
Posts: 98
Joined: Mon Aug 09, 2010 11:00 am

Re: To Antonio and all Simply Test ExplorerBar RESOLVED!

Postby andresreyes_mzt » Fri Aug 20, 2010 3:34 pm

Otto,

I'm agree with you

Will be great if silvio shares his solution, but it's not her obligation



Uwe.Diemer,

It's not our business, Who is using somebody's computer, Who are their good "friends".
Including if you have any personal issue with Silvio, It's not our business.

Regards.
{{{ ---- xharbour + Borland C --- }}}
User avatar
andresreyes_mzt
 
Posts: 71
Joined: Fri Jan 11, 2008 6:55 am
Location: Mexico

Next

Return to FiveWin for Harbour/xHarbour

Who is online

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