a Main wnd with two ScrollPanel +buttonbar+msgbar

a Main wnd with two ScrollPanel +buttonbar+msgbar

Postby Silvio.Falconi » Fri Feb 17, 2023 9:50 am

I wish create a window with two srollpanel

Image

The first scrollpanel ( a left) is ok .
the second ScrollPanel ( at right) I not see the scroll ( because I not Know the right position)

Can you help me pls ?

the test
Code: Select all  Expand view

#include "fivewin.ch"

REQUEST DBFCDX

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

function Main()
   local oWnd,oBar
   local oDash_Left,oDash_Right

  DEFINE WINDOW oWnd TITLE "Test silvio" //MDI

  DEFINE BUTTONBAR oBar OF oWnd 2015 SIZE 70, 60

   oDash_Left   := Create_Scroll(oWnd,nRgb( 255,255,255), nRgb(240,240,240),oBar,1)
   oDash_Right  := Create_Scroll(oWnd, RGB(143,172,230), nRgb(255,255,255),oBar,2)

   DEFINE MSGBAR PROMPT "Test "    OF oWnd 2015 KEYBOARD DATE

   PlaceControls( oDash_Left, oDash_Right )

   oWnd:bResized := {|| (oDash_Left:nHeight := oWnd:nHeight - 125 ,;
                         oDash_Left:nWidth  := oWnd:nWidth/2 +100     ,;
                         oDash_Left:Refresh()                     ,;
                         oDash_right:nHeight := oWnd:nHeight - 125,;
                         oDash_right:nLeft   := oDash_Left:nWidth+10,;
                         oDash_right:nWidth  := oWnd:nWidth-520 ,;
                         oDash_right:Refresh(),;
                         oDash_Left:Checkresize(),;
                         oDash_Right:Checkresize() )}
   oWnd:aMinMaxInfo := { nil, nil, ,, 1130,650, , }
   ACTIVATE WINDOW oWnd MAXIMIZED
   RETURN NIL
//----------------------------------------------------------------------//
Function Create_Scroll(oWnd,nColor1,nColor2,oBar,nMode)
  local oPanel
  local aGradBox := { nColor1,nColor2}
  local oBrush

  local aClient := GetClientRect (oWnd:hWnd )
  local nRight  := (aClient[4]/2)

     DEFINE BRUSH oBrush GRADIENT aGradBox
     Do case
        case nMode == 1
          oPanel := TScrollPanel():New(oBar:nheight,1,oWnd:nBottom,oWnd:nWidth/2 +100,oWnd, .t.)
        case nMode == 2
         oPanel := TScrollPanel():New(oBar:nheight,300,oWnd:nBottom,nRight,oWnd, .t.)
     Endcase
     oPanel:SetBrush( oBrush )
  RETURN oPanel
//----------------------------------------------------------------------//

function PlaceControls( oPanelR, oPanelL )    //demo

   local nRow  := 30

   @ nRow,  20 SAY "First :"  SIZE 080,24 PIXEL OF oPanelR RIGHT TRANSPARENT

   nRow  += 30
   @ nRow,  20 SAY "Last :"   SIZE 080,24 PIXEL OF oPanelR RIGHT TRANSPARENT

   nRow  += 30
   @ nRow,  20 SAY "Street :"   SIZE 080,24 PIXEL OF oPanelR RIGHT TRANSPARENT

   nRow  += 30
   @ nRow,  20 SAY "City :"   SIZE 080,24 PIXEL OF oPanelR RIGHT TRANSPARENT

   nRow  += 30
   @ nRow,  20 SAY "State :"   SIZE 080,24 PIXEL OF oPanelR RIGHT TRANSPARENT


   nRow  := 10
   @ nRow,  20 SAY "Zip :"   SIZE 080,24 PIXEL OF oPanelL RIGHT TRANSPARENT

   nRow  += 30
   @ nRow,  20 SAY "HireDate :"   SIZE 080,24 PIXEL OF oPanelL RIGHT TRANSPARENT

   nRow  += 30
   @ nRow,  20 SAY "Married :"   SIZE 080,24 PIXEL OF oPanelL RIGHT TRANSPARENT

   nRow  += 30
   @ nRow,  20 SAY "Age :"   SIZE 080,24 PIXEL OF oPanelL RIGHT TRANSPARENT

   nRow  += 30
   @ nRow,  20 SAY "Salary :"   SIZE 080,24 PIXEL OF oPanelL RIGHT TRANSPARENT

   nRow  += 30
   @ nRow,  20 SAY "Notes :"   SIZE 080,24 PIXEL OF oPanelL RIGHT TRANSPARENT


    oPanelR:SetRange() // call this after defining all controls
    oPanelL:SetRange() // call this after defining all controls

return ni
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: a Main wnd with two ScrollPanel +buttonbar+msgbar

Postby Jimmy » Fri Feb 17, 2023 10:50 am

hi Silvo,
instead of
Code: Select all  Expand view
  oDash_right:nWidth  := oWnd:nWidth-520 ,;

try
Code: Select all  Expand view
  oDash_right:nWidth  := oWnd:nWidth-oDash_Left:nWidth -30 ,;


p.s. what du you think about a SPLITTER :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: a Main wnd with two ScrollPanel +buttonbar+msgbar

Postby Silvio.Falconi » Fri Feb 17, 2023 11:01 am

Jimmy wrote:hi Silvo,
instead of
Code: Select all  Expand view
  oDash_right:nWidth  := oWnd:nWidth-520 ,;

try
Code: Select all  Expand view
  oDash_right:nWidth  := oWnd:nWidth-oDash_Left:nWidth -30 ,;


p.s. what du you think about a SPLITTER :?:

splitter ok but it must be hide
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 83 guests