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

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

Postby Jimmy » 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 ?
Image
Code: Select all  Expand view  RUN
  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
User avatar
Jimmy
 
Posts: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

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

Postby Silvio.Falconi » 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 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
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

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

Postby Antonio Linares » 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 ?
Image
Code: Select all  Expand view  RUN
  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
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby Jimmy » Sat Feb 24, 2024 2: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: Select all  Expand view  RUN
  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: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

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

Postby Jimmy » Sat Feb 24, 2024 2: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: Select all  Expand view  RUN
  DATA   lCollapsed      INIT .F.

and it will be assign Value in
Code: Select all  Expand view  RUN
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
Jimmy
 
Posts: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

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

Postby Antonio Linares » Sat Feb 24, 2024 6: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: Select all  Expand view  RUN
     ::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
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby Jimmy » Sat Feb 24, 2024 6: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: Select all  Expand view  RUN
METHOD LButtonUp( nRow, nCol )

include DATA lDrag and ::Capture()
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

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

Postby Jimmy » Mon Feb 26, 2024 1:04 am

hi,

i got bOnCollapse working :D
Code: Select all  Expand view  RUN
  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 view  RUN
     if ! Empty( ::bOnCollapse )   // new
         Eval( ::bOnCollapse, Self )   // new
      endif    // new

so this is my Solution
Code: Select all  Expand view  RUN
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
Jimmy
 
Posts: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

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

Postby Silvio.Falconi » 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 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
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

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

Postby Jimmy » 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
User avatar
Jimmy
 
Posts: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

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

Postby Silvio.Falconi » Wed Feb 28, 2024 8:37 am

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
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

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

Postby Jimmy » Wed Feb 28, 2024 11:54 pm

hi Silvio,

you are Right that Original CLASS TTaskPanel() Layout are
Code: Select all  Expand view  RUN
  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 view  RUN
  yPos +=aPanels[n]:nHeight + 20


---

to enhance CLASS TExplorerBar we can look into CLASS TExplorerList
Code: Select all  Expand view  RUN
METHOD DelChilds( uVal ) CLASS TExplorerList
METHOD DelItem( uVal ) CLASS TExplorerList
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 77 guests

cron