FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour how get Event from TExplorerBar() when "collaps" a Panel ?
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
how get Event from TExplorerBar() when "collaps" a Panel ?
Posted: Sat Feb 24, 2024 10:37 AM
hi,

i have work TExplorerBar() 1st Time and i begin to understand how it work
but there is no Dokumentation even Fivewin-Wiki about TExplorerBar()

Question
how get Event from TExplorerBar() when "collaps" a Panel ?
Code (fw): Select all Collapse
   oExBar = TExplorerBar():New()
   oPanel1 = oExBar:AddPanel( "One", "..\bitmaps\32x32\people.bmp" )
full Sample CODE you find here
https://forums.fivetechsupport.com/viewtopic.php?f=3&t=44043
greeting,

Jimmy
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: how get Event from TExplorerBar() when "collaps" a Panel ?
Posted: Sat Feb 24, 2024 12:28 PM

See checkscroll method

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: how get Event from TExplorerBar() when "collaps" a Panel ?
Posted: Sat Feb 24, 2024 12:57 PM
Jimmy wrote:hi,

i have work TExplorerBar() 1st Time and i begin to understand how it work
but there is no Dokumentation even Fivewin-Wiki about TExplorerBar()

Question
how get Event from TExplorerBar() when "collaps" a Panel ?
Code (fw): Select all Collapse
   oExBar = TExplorerBar():New()
   oPanel1 = oExBar:AddPanel( "One", "..\bitmaps\32x32\people.bmp" )
full Sample CODE you find here
https://forums.fivetechsupport.com/viewtopic.php?f=3&t=44043
Dear Jimmy,

TExplorerBar has no currently support for such event but it can be easily implemented from:

METHOD LButtonUp( nRow, nCol, nFlags ) CLASS TTaskPanel
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: how get Event from TExplorerBar() when "collaps" a Panel ?
Posted: Sat Feb 24, 2024 02:33 PM
hi Silvio,
Silvio.Falconi wrote:See checkscroll method
thx for Answer

but how to "react" to call Method ChekScroll() :?:

when "click" there will be WM_LBUTTONDOWN / WM_LBUTTONUP Event fired
for this we have Codeblock-Slot like in c:\fwh\samples\testmmd.prg
Code (fw): Select all Collapse
   oWndMOUSE:bLClicked    = { | nRow, nCol, nFlags | oWndMOUSE:Say( 2, 2,  "LButtonDown" ) }
   oWndMOUSE:bLButtonUp   = { | nRow, nCol, nFl8ags | oWndMOUSE:Say( 2, 2, "LButtonUp    " ) }
greeting,

Jimmy
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: how get Event from TExplorerBar() when "collaps" a Panel ?
Posted: Sat Feb 24, 2024 02:53 PM
hi Antonio,
Antonio Linares wrote:TExplorerBar has no currently support for such event but it can be easily implemented from:

METHOD LButtonUp( nRow, nCol, nFlags ) CLASS TTaskPanel
thx for Answer

there is in CLASS TTaskPanel
Code (fw): Select all Collapse
   DATA   lCollapsed      INIT .F.
and it will be assign Value in
Code (fw): Select all Collapse
METHOD LButtonUp(nRow, nCol, nFlags ) CLASS TTaskPanel
but there is no Codeblock-Slot like bLButtonUp which will "react" when click on "Collaps" :(
i do not understand "when" to call LButtonUp()

Question : where are Titlebar Resource of TTaskPanel() come from :?:
greeting,

Jimmy
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: how get Event from TExplorerBar() when "collaps" a Panel ?
Posted: Sat Feb 24, 2024 06:12 PM
Dear Jimmy,

On CLASS TTaskPanel FROM TControl add this DATA:

DATA bOnCollapse

and then add this code at the bottom of METHOD LButtonUp( nRow, nCol, nFlags ) CLASS TTaskPanel:
Code (fw): Select all Collapse
      ::oWnd:CheckScroll()

      if ! Empty( ::bOnCollapse )   // new
         Eval( ::bOnCollapse, Self )   // new
      endif    // new
   endif
We are adding these changes for next FWH build
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: how get Event from TExplorerBar() when "collaps" a Panel ?
Posted: Sat Feb 24, 2024 06:32 PM
hi Antonio,

Codeblock-Slot like these we need, thx
but how is METHOD LButtonUp() called when i click to collaps/enlarge :?:

Request :
also need for DragDrop
Code (fw): Select all Collapse
METHOD LButtonUp( nRow, nCol )
include DATA lDrag and ::Capture()
greeting,

Jimmy
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: how get Event from TExplorerBar() when "collaps" a Panel ?
Posted: Mon Feb 26, 2024 01:04 AM
hi,

i got bOnCollapse working :D
Code (fw): Select all Collapse
   oPanel1:bOnCollapse :=  { | | CheckCollapse(oPanel1,cMsg,1) }
   oPanel2:bOnCollapse :=  { | | CheckCollapse(oPanel2,cMsg,2) }
   oPanel3:bOnCollapse :=  { | | CheckCollapse(oPanel3,cMsg,3) }
i don´t know how but METHOD LButtonUp will be "automatic" called which include
Code (fw): Select all Collapse
      if ! Empty( ::bOnCollapse )   // new
         Eval( ::bOnCollapse, Self )   // new
      endif    // new
so this is my Solution
Code (fw): Select all Collapse
PROCEDURE CheckCollapse(oPanel,cMessage,nPanel)
LOCAL n, yPos := 0
LOCAL aDim
local oFonttext

   DEFINE FONT oFonttext NAME "Verdana" SIZE 0, -12

   IF oPanel:lCollapsed = .T.
      // do nothing
   ELSE
      DO CASE
         CASE nPanel = 1
            // fix Size
            oPanel:nHeight      := 80
         CASE nPanel = 2
            aDim = GetLabelDim( oPanel:hWnd, alltrim(cMessage), oFonttext:hFont )
            oPanel:nHeight     := aDim[ 2 ] + (3 * (oFonttext:nHeight() +2) )
            oPanel:nBodyHeight := oPanel:nHeight - oPanel:nTitleHeight
         CASE nPanel = 3
            // fix Size
            oPanel:nHeight      := 80
      ENDCASE
   ENDIF

   // re-position
   for n= 1 to Len( oExbar:aPanels )

   //  move Panel to new Position
       oExbar:aPanels[n]:Move(yPos)

       oExbar:aPanels[n]:nBodyHeight := oExbar:aPanels[n]:nHeight - oExbar:aPanels[n]:nTitleHeight

       oExbar:aPanels[n]:CoorsUpdate()
       oExbar:aPanels[n]:UpdateRegion()

       oExbar:CheckScroll()
       yPos += oExbar:aPanels[n]:nHeight + 20
   next

   RELEASE oFonttext
*   oExbar:Refresh()
   invalidateRect(oExbar:hwnd,0, .T. )

RETURN
greeting,

Jimmy
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: how get Event from TExplorerBar() when "collaps" a Panel ?
Posted: Tue Feb 27, 2024 11:43 AM

a question

yPos := 0

this is no good because the first panel can init from 18 and not from 0 row

I not found the exact variable perhaps ::nTop ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: how get Event from TExplorerBar() when "collaps" a Panel ?
Posted: Tue Feb 27, 2024 10:40 PM
hi Silvio,
Silvio.Falconi wrote:a question

yPos := 0

this is no good because the first panel can init from 18 and not from 0 row

I not found the exact variable perhaps ::nTop ?
as i can say it is 1st Position of "Body" from TExplorerBar() where i oExBar:AddPanel()
greeting,

Jimmy
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: how get Event from TExplorerBar() when "collaps" a Panel ?
Posted: Wed Feb 28, 2024 08:37 AM
Jimmy wrote:hi Silvio,
a question

yPos := 0

this is no good because the first panel can init from 18 and not from 0 row

I not found the exact variable perhaps ::nTop ?
as i can say it is 1st Position of "Body" from TExplorerBar() where i oExBar:AddPanel()
yes but the first position of First TaskPanelPanel is never 0

Please try fwh\samples\explbar.prg and see it the first taskpanel not is on 0 row
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: how get Event from TExplorerBar() when "collaps" a Panel ?
Posted: Wed Feb 28, 2024 11:54 PM
hi Silvio,

you are Right that Original CLASS TTaskPanel() Layout are
Code (fw): Select all Collapse
   DATA   nTopMargin      INIT 16
but i just show Technic how to get Event, when Collaps, and "move" Panels to new Position
where i start from TOP = 0 in my Layout

it is up to you to change Layout like SPACE between TTaskPanel()
Code (fw): Select all Collapse
   yPos +=aPanels[n]:nHeight + 20
---

to enhance CLASS TExplorerBar we can look into CLASS TExplorerList
Code (fw): Select all Collapse
METHOD DelChilds( uVal ) CLASS TExplorerList
METHOD DelItem( uVal ) CLASS TExplorerList
greeting,

Jimmy

Continue the discussion