how to change the size of an xbrowse in runtime

Re: how to change the size of an xbrowse in runtime

Postby Otto » Fri May 03, 2024 4:46 pm

Hello friends,
For anyone interested in solutions with mod_harbour or WebView2:
There is a solution with mod_harbour for this issue.
Here is the link: Feel free to check it out!

viewtopic.php?f=45&t=44481&p=269851&sid=47b4a676d7650c0bd41dd07071e78bcb#p269851

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: 6041
Joined: Fri Oct 07, 2005 7:07 pm

Re: how to change the size of an xbrowse in runtime

Postby Silvio.Falconi » Sun May 05, 2024 4:17 pm

Otto wrote:Hello friends,
For anyone interested in solutions with mod_harbour or WebView2:
There is a solution with mod_harbour for this issue.
Here is the link: Feel free to check it out!

viewtopic.php?f=45&t=44481&p=269851&sid=47b4a676d7650c0bd41dd07071e78bcb#p269851

Best regards,
Otto


in fwh ? no webview no html ? no modharbour pls
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: 6831
Joined: Thu Oct 18, 2012 7:17 pm

Re: how to change the size of an xbrowse in runtime

Postby Silvio.Falconi » Sun May 05, 2024 4:28 pm

Please seeing the picture

Image

if I select "age" I go to activate the age filters but I go to activate box number 3, the topmost one, how can I make it so that if the first box is not activated, the age box takes the coordinates of the first box?

that is, to make you understand


Image


then if I pressed "age" the checkbox must be first, that is, it must move to the first place and consequently the box must be before the other



the test
Code: Select all  Expand view

#include 'fivewin.ch'
#include 'xbrowse.ch'
#include 'constant.ch'

 #define DLG_nColorDlg     RGB(245,245,235)
 #define DLG_nColortitle1  RGB(219,230,244)
 #define DLG_nColortitle2  RGB(207,221,239)
 #define DLG_nColorBar1    RGB(250,250,245)
 #define DLG_nColorBar2    RGB(245,245,235)
 #define DLG_nColorBtn1    RGB(245,245,235)
 #define DLG_nColorBtn2    RGB(250,250,245)
 #define DLG_nColorBtnB    RGB(195,195,185)


REQUEST DBFCDX

Function test()
   local oDlg, oBrw, oFont,oBold, oList,oBrush
         local nBottom:= 32.4
         local nRight := 95
         local nHt       := nBottom * DLG_CHARPIX_H
         local nWd       := Max( nRight * DLG_CHARPIX_W, 180 )
         local oBox:=array(3)

   local  aCols    := { ;
                   { "FIRST",   "First"   ,,   80, },;
                   { "LAST",    "Last",,   80, },;
                   { "STREET",  "Address"   ,,   100, },;
                   { "CITY",    "City"        ,,   90, } }

   local oSayfiltro
   local oCbx1,lmarried:=.f.
   local oCbx2,lAge:=.f.
   local nMarried,oCbx3
   local nRow:= 420,nCol:= 10
   local nInterlinea := 20
   local aGradgreen := { Rgb(250,250,245),rgb(210,210,205)}

       oList:=TCustomer():New()
       oList:setorder(1)
       oList:Gotop()

  oFont := TFont():New( "TAHOMA", 0, 14,, )
  oBold := TFont():New( "TAHOMA", 0, 14,,.t. )
  DEFINE BRUSH oBrush   STYLE BDIAGONAL COLOR  Rgb(195,195,185)

   DEFINE DIALOG oDlg SIZE nWd, nHt PIXEL TRUEPIXEL;
       FONT oFont   COLOR CLR_BLACK, RGB(245,245,235)  ;
       STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
                  WS_MINIMIZEBOX)

   @ 40,10 XBROWSE oBrw SIZE -10,390 PIXEL OF oDlg ;
          DATASOURCE oList COLUMNS aCols ;
          AUTOSORT FONT oFont;
          NOBORDER CELL LINES

  // MyStyleBrowse(oBrw,oBrush)

 WITH OBJECT oBrw
  :nRowHeight          := 25
            :l2007               := .F.
            :l2015               := .T.
            :lRecordSelector     := .F.
            :nColDividerStyle    := LINESTYLE_LIGHTGRAY
            :nRowDividerStyle    := LINESTYLE_LIGHTGRAY
            :nStretchCol         := STRETCHCOL_WIDEST
            :nMarqueeStyle        := MARQSTYLE_HIGHLROW


   :CreateFromCode()
END






    oBox[1]:=MyBox(nRow+8, 2,oDlg:nWidth-10,30,Rgb(250,250,245),rgb(210,210,205))
    nRow -=31
    oBox[2]:=MyBox(nRow, 2,oDlg:nWidth-10,30,Rgb(250,250,245),rgb(210,210,205))
    nRow -=31
    oBox[3]:=MyBox(nRow, 2,oDlg:nWidth-10,30,Rgb(250,250,245),rgb(210,210,205))


  ACTIVATE DIALOG oDlg CENTERED ;
  ON INIT (oBox[2]:hide(),oBox[3]:Hide(),;
                 Config_Form(oBox,oFont,oBold,oDlg,oBrw) )

   RELEASE FONT oFont

   return nil



   Function Config_Form(oBox,oFont,oBold,oDlg,oBrw)
   local aDat:=array(20)
   local nRow:= 0,nCol:= 10
   local nInterlinea := 30

   local axArray :={ { .F., "Married"   },;
                     { .F., "Age"   },;
                     { .F., "Married"   },;
                     { .F., "Not Married"   },;
                     { .F., "20"   },;
                     { .F., "over 50"   }}


   STATIC l01, l02, l03, l04, l05, l06 := .F.



    @ 2,5 Say oSay Prompt "Filter by  " size 80,20 PIXEL of oBox[1]  ;
                          COLOR CLR_BLACK, Rgb(250,250,245)
              oSay:lTransparent:=.t.
     // articoli
   l01:= axArray[ 1, 1 ]

     @  8,oBox[1]:nLeft+120  CHECKBOX  aDat[ 1] VAR l01 Prompt axArray[ 1, 2 ] SIZE 90,  11 PIXEL OF oBox[1] ;
          COLOR CLR_BLACK, Rgb(250,250,245) FONT oBold ;
            ON CHANGE ( ChangeSizeBrw( l01, l02, oBox, oBrw ) )

    l02:= axArray[ 2, 1 ]

      @  8,oBox[1]:nLeft+300  CHECKBOX  aDat[ 2] VAR l02 Prompt axArray[ 2, 2 ] SIZE 90,  20 PIXEL OF oBox[1] ;
          COLOR CLR_BLACK, Rgb(250,250,245) FONT oBold ;
            ON CHANGE ( ChangeSizeBrw( l01, l02, oBox, oBrw ) )

     aDat[ 1]:lTransparent:=.t.
     aDat[ 2]:lTransparent:=.t.


      l03:= axArray[ 3, 1 ]
     @ 2,5 Say oSay Prompt "Married  " size 80,20 PIXEL of oBox[2] TRANSPARENT ;
                          COLOR CLR_BLACK, Rgb(250,250,245)

      @  8,oBox[1]:nLeft+120  CHECKBOX  aDat[ 3] VAR l03 Prompt axArray[ 3, 2 ] SIZE 90,  20 PIXEL OF oBox[2] ;
          COLOR CLR_BLACK, Rgb(250,250,245) FONT oBold   WHEN  l01

      aDat[ 3]:lTransparent:=.t.

        l04:= axArray[ 4, 1 ]

       @  8,oBox[1]:nLeft+300  CHECKBOX  aDat[ 4] VAR l04 Prompt axArray[ 4, 2 ] SIZE 90,  20 PIXEL OF oBox[2] ;
          COLOR CLR_BLACK, Rgb(250,250,245) FONT oBold   WHEN  l01

         aDat[ 4]:lTransparent:=.t.


      l05:= axArray[ 5, 1 ]
     @ 2,5 Say oSay Prompt "Age  " size 80,20 PIXEL of oBox[3] TRANSPARENT ;
                          COLOR CLR_BLACK, Rgb(250,250,245)

      @  8,oBox[1]:nLeft+120  CHECKBOX  aDat[ 5] VAR l05 Prompt axArray[ 5, 2 ] SIZE 90,  20 PIXEL OF oBox[3] ;
          COLOR CLR_BLACK, Rgb(250,250,245) FONT oBold   WHEN  l02
           aDat[ 5]:lTransparent:=.t.


           l06:= axArray[ 6, 1 ]

       @  8,oBox[1]:nLeft+300  CHECKBOX  aDat[ 6] VAR l06 Prompt axArray[ 6, 2 ] SIZE 90,  20 PIXEL OF oBox[3] ;
          COLOR CLR_BLACK, Rgb(250,250,245) FONT oBold   WHEN  l02
           aDat[ 6]:lTransparent:=.t.

      RETURN NIL




//---------------------------------------------------------------------//
 Function MyBox(nTop, nLeft, nBottom, nRight,nClrLite, nClrDark)
   local cType:= "GBOX"
   return TSLines():New( nTop, nLeft, nBottom, nRight, cType, , nClrLite, nClrDark)
//---------------------------------------------------------------------//

CLASS TXData from TDatabase
      DATA cDbfPath   init ".\"
     ENDCLASS
CLASS TCustomer from TXData
   METHOD New()
ENDCLASS
 METHOD New( lShared ) CLASS TCustomer
   Default lShared := .t.
   ::super:New(,::cDbfPath + "
Customer" ,"DBFCDX", lShared)
   if ::use()
      ::setOrder(1)
      ::gotop()
   endif
   RETURN Self





Function ChangeSizeBrw( l01, l02, oBox, oBrw )
   LOCAL nHeight
   
   DO CASE
      CASE !l01 .AND. !l02
           nHeight := 390
           oBox[2]:Hide()
           oBox[3]:Hide()
      CASE l01 .AND. !l02
           nHeight := 340
           oBox[2]:Show()
           oBox[3]:Hide()
      CASE !l01 .AND. l02
           nHeight := 310
           oBox[2]:Hide()
           oBox[3]:Show()
      CASE l01 .AND. l02
           nHeight := 310
           oBox[2]:Show()
           oBox[3]:Show()
   ENDCASE
   
   oBrw:SetSize( oBrw:nWidth , nHeight, .T. )
   oBrw:refresh(.f.)

Return(NIL)
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: 6831
Joined: Thu Oct 18, 2012 7:17 pm

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 27 guests