how get Event from TExplorerBar() when "collaps" a Panel ?

Post Reply
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

how get Event from TExplorerBar() when "collaps" a Panel ?

Post by Jimmy »

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 ?
Image

Code: Select all | Expand

   oExBar = TExplorerBar():New()
   oPanel1 = oExBar:AddPanel( "One", "..\bitmaps\32x32\people.bmp" )
full Sample CODE you find here
https://forums.fivetechsupport.com/view ... =3&t=44043
greeting,
Jimmy
User avatar
Silvio.Falconi
Posts: 7136
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: how get Event from TExplorerBar() when "collaps" a Panel ?

Post by Silvio.Falconi »

See checkscroll method
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Antonio Linares
Site Admin
Posts: 42521
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 75 times
Contact:

Re: how get Event from TExplorerBar() when "collaps" a Panel ?

Post by Antonio Linares »

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 ?
Image

Code: Select all | Expand

   oExBar = TExplorerBar():New()
   oPanel1 = oExBar:AddPanel( "One", "..\bitmaps\32x32\people.bmp" )
full Sample CODE you find here
https://forums.fivetechsupport.com/view ... =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
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: how get Event from TExplorerBar() when "collaps" a Panel ?

Post by Jimmy »

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: Select all | Expand

   oWndMOUSE:bLClicked    = { | nRow, nCol, nFlags | oWndMOUSE:Say( 2, 2,  "LButtonDown" ) }
   oWndMOUSE:bLButtonUp   = { | nRow, nCol, nFl8ags | oWndMOUSE:Say( 2, 2, "LButtonUp    " ) }
greeting,
Jimmy
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: how get Event from TExplorerBar() when "collaps" a Panel ?

Post by Jimmy »

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: Select all | Expand

   DATA   lCollapsed      INIT .F.
and it will be assign Value in

Code: Select all | Expand

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
User avatar
Antonio Linares
Site Admin
Posts: 42521
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 75 times
Contact:

Re: how get Event from TExplorerBar() when "collaps" a Panel ?

Post by Antonio Linares »

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: Select all | Expand

      ::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
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: how get Event from TExplorerBar() when "collaps" a Panel ?

Post by Jimmy »

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: Select all | Expand

METHOD LButtonUp( nRow, nCol )
include DATA lDrag and ::Capture()
greeting,
Jimmy
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: how get Event from TExplorerBar() when "collaps" a Panel ?

Post by Jimmy »

hi,

i got bOnCollapse working :D

Code: Select all | Expand

   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: Select all | Expand

      if ! Empty( ::bOnCollapse )   // new
         Eval( ::bOnCollapse, Self )   // new
      endif    // new
so this is my Solution

Code: Select all | Expand

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
User avatar
Silvio.Falconi
Posts: 7136
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: how get Event from TExplorerBar() when "collaps" a Panel ?

Post by Silvio.Falconi »

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 November 2023 - January 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
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: how get Event from TExplorerBar() when "collaps" a Panel ?

Post by Jimmy »

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
User avatar
Silvio.Falconi
Posts: 7136
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: how get Event from TExplorerBar() when "collaps" a Panel ?

Post by Silvio.Falconi »

Jimmy wrote: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()
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 November 2023 - January 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
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: how get Event from TExplorerBar() when "collaps" a Panel ?

Post by Jimmy »

hi Silvio,

you are Right that Original CLASS TTaskPanel() Layout are

Code: Select all | Expand

   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: Select all | Expand

   yPos +=aPanels[n]:nHeight + 20
---

to enhance CLASS TExplorerBar we can look into CLASS TExplorerList

Code: Select all | Expand

METHOD DelChilds( uVal ) CLASS TExplorerList
METHOD DelItem( uVal ) CLASS TExplorerList
greeting,
Jimmy
Post Reply