Page 1 of 3

oWnd:oClient := oPanel

Posted: Tue May 28, 2019 4:32 pm
by Otto
Hello,
is it possible to have oWnd:oClient := oPanel in combination with
oPanel:nTop := 20
Thank you in advance
Otto

Re: oWnd:oClient := oPanel

Posted: Tue May 28, 2019 4:44 pm
by Silvio.Falconi
I not understood can make a test sample ?

Re: oWnd:oClient := oPanel

Posted: Tue May 28, 2019 5:02 pm
by Otto
Hello Silvio,
In the meantime I found a solution.
But there is another problem. It seems we can't make resizeable windows without a border.
Thank you and best regards
Otto

oWnd:bPainted = { || oPanel:nTop := 30 }

Image

Re: oWnd:oClient := oPanel

Posted: Tue May 28, 2019 5:24 pm
by ukoenig
Otto,
But there is another problem. It seems we can't make resizeable windows without a border.
it is possible

http://forums.fivetechsupport.com/viewt ... 95#p221895

regards
Uwe :D

Re: oWnd:oClient := oPanel

Posted: Tue May 28, 2019 5:51 pm
by Otto
Hallo Uwe,
danke.
Das funkioniert leider nicht.
Das Fenster ist rahmenlos aber die Größe kann nicht verändert werden.
Liebe Grüße
Otto

Re: oWnd:oClient := oPanel

Posted: Tue May 28, 2019 11:42 pm
by Silvio.Falconi
Otto wrote:Hello Silvio,
In the meantime I found a solution.
But there is another problem. It seems we can't make resizeable windows without a border.
Thank you and best regards
Otto

oWnd:bPainted = { || oPanel:nTop := 30 }

Image

Now I understand sorry
What you use to make the window ..window or dialog ?

I thinkyou must use a dialog command with RESIZABLE then you can make a bresized codeblock where you can set the panel ( are you using tpanelscroll ?)

I made a type of that you want make ( only I insert two xbrowse) but the system is the same


Image
I used

DEFINE DIALOG oDlgTariffe SIZE 880,600 ;
PIXEL TRUEPIXEL RESIZABLE FONT oFont

oDlgTariffe:aMinMaxInfo := { nil, nil, nil, nil, 878, 570, nil, nil } //878, 570

oDlgTariffe:bResized := <||
local oRect := oDlgTariffe:GetCliRect()
local x:= oBrw1:nBottom

oBtnCheck:nLeft := oRect:nRight - 395
oBtnCheck:nTop := oRect:nBottom - 50

oBtnPrint:nLeft := oRect:nRight - 220
oBtnPrint:nTop := oRect:nBottom - 50

oBtnClose:nLeft := oRect:nRight - 120
oBtnClose:nTop := oRect:nBottom - 50
RETURN nil
>


ACTIVATE DIALOG oDlgTariffe CENTERED


you can on oDlgTariffe:bResized insert the refresh of Panel you wish

Re: oWnd:oClient := oPanel

Posted: Wed May 29, 2019 6:27 am
by Otto
Hello Silvio,
I tried your code but with your code the DIALOG has a frame.
If I add WS_POPUP style I have no Frame but can't resize the DIALOG.

DEFINE DIALOG oDlg SIZE 880,600 ;
PIXEL TRUEPIXEL RESIZABLE //FONT oFont


// STYLE WS_POPUP

Best regards
Otto

Re: oWnd:oClient := oPanel

Posted: Wed May 29, 2019 6:59 am
by Silvio.Falconi
wich is FRAME ?

Re: oWnd:oClient := oPanel

Posted: Wed May 29, 2019 9:23 am
by Otto
Hello Silvio,
regards
Otto

Code: Select all

#include "FiveWin.ch"

static oDlg

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

function Main()

DEFINE DIALOG oDlg  SIZE 880,600 ;
PIXEL TRUEPIXEL RESIZABLE //FONT oFont


// STYLE  WS_POPUP


/*
oDlg:aMinMaxInfo := { nil, nil, nil, nil, 878, 570, nil, nil } //878, 570

oDlg:bResized := <||
local oRect := oDlg:GetCliRect()
local x:= oBrw1:nBottom

oBtnCheck:nLeft := oRect:nRight - 395
oBtnCheck:nTop := oRect:nBottom - 50

oBtnPrint:nLeft := oRect:nRight - 220
oBtnPrint:nTop := oRect:nBottom - 50

oBtnClose:nLeft := oRect:nRight - 120
oBtnClose:nTop := oRect:nBottom - 50
RETURN nil
>

*/
ACTIVATE DIALOG oDlg CENTERED

return nil

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

Image

Re: oWnd:oClient := oPanel

Posted: Wed May 29, 2019 10:02 am
by Silvio.Falconi
Otto,

test made in 5 minutes

Image


Code

Code: Select all

#include "FiveWin.ch"

static oDlg

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

function Main()

   Local oPanelScroll
   Local oFont1,oFontG
   Local oSay
   Local oGet
   local cFind      := ""
   local cPrompt    := "Setup of Windows ( FWH BtnBmp Demo )"


   DEFINE FONT oFont1 NAME "Segoe UI Light" SIZE 0,-24
 DEFINE FONT oFontG NAME "Segoe UI" SIZE 0,-18


 DEFINE DIALOG oDlg  SIZE 880,600 ;
PIXEL TRUEPIXEL RESIZABLE //FONT oFont

   @ 20, 160 SAY oSay PROMPT cPrompt OF oDlg PIXEL FONT oFont1 SIZE 420, 40
   @ 70, 170 GET oGet VAR    cFind   OF oDlg PIXEL FONT oFontG SIZE 400, 36
   *  CUEBANNER "Find a setting"



oDlg:bResized := <||
local oRect := oDlg:GetCliRect()

oSay:nLeft := oRect:nLeft +160
oSay:nTop := oRect:ntop + 30

oGet:nLeft := oRect:nLeft +170
oGet:nTop := oRect:nTop + 70


RETURN nil
>

*/
ACTIVATE DIALOG oDlg CENTERED ;
 ON INIT( oPanelScroll := CreatePanel( oDlg,oGet ),;
          oPanelScroll:CheckResize(),;
          eval(oDlg:bResized)              )
return nil

//----------------------------------------------------------------------------//
    function CreatePanel( oDlg,oGet )
      local oPanel
     local oBold
     local aGrad  := { { 1, RGB( 216, 230, 238 ), RGB( 103, 154, 194 ) } }
     local aBtns    := { ;
                      { "System" + CRLF + "Screen, notifications," + CRLF + "power", 0xE770, { || Dummy() } }, ;
                      { "Devices" + CRLF + "Bluetooth, printers," + CRLF + "mouse", 0xE772, { || Dummy() } }, ;
                      { "Mobile" + CRLF + "Link your Android, iPhone" + CRLF, 0xE1C9, { || Dummy() } }, ;
                      { "Network && Internet" + CRLF + "WIFI, flight mode" + CRLF + "VPN", 0xE12b, { || Dummy() } }, ;
                      { "Personalization" + CRLF + "Background, lock screen" + CRLF, 0xE771, { || Dummy() } }, ;
                      { "Apps" + CRLF + "Uninstall defaults" + CRLF + "Optional Features", 0xE179, { || Dummy() } }, ;
                      { "Account" + CRLF + "Your account, email sync" + CRLF + "Work family", 0xE77B, { || Dummy() } }, ;
                      { "Time and language" + CRLF + "Voice, region, date" + CRLF, 0xE775, { || Dummy() } }, ;
                      { "Games" + CRLF + "Game bar, DVR," + CRLF + "retransmission and game mode", 0xE909, { || Dummy() } }, ;
                      { "Accessibility" + CRLF + "Narrator, magnifying glass," + CRLF + "high contrast", 0xE776, { || Dummy() } }, ;
                      { "Cortana" + CRLF + "Language of Cortana," + CRLF + "permissions, notifications", 0xECCA, { || Dummy() } }, ;
                      { "Privacy" + CRLF + "Location Camera" + CRLF, 0xE1F6, { || Dummy() } }, ;
                      { "Update && Security" + CRLF + "Windows Update" + CRLF + "Recovery", 0xE777, { || Dummy() } } ;
                     }

   local nRow       := 10
   local nCol       := 10
   local nClrBack   := CLR_WHITE
   local nW         := 200
   local nH         := 140
   local nCBorder   := 0xC38B2B
   local nClrText   := CLR_BLACK
   local nClrBorder := 0xE6E6E6

   DEFINE FONT oFont  NAME "Segoe UI" SIZE 0,-14

   DEFINE FONT oBold  NAME "Segoe UI" SIZE 0,-14 BOLD



     WITH OBJECT oGet
      :bAction       := { || Dummy() }
      :cBmpName      := 0xE11A
      :lBtnTransparent  := .t.
      :CreateButton()
   END




     oPanel   := TScrollPanel():New( 135,010,180,550,oDlg, .t. )
     oPanel:nRightMargin     := 2
     oPanel:nBottomMargin    := 5
     oPanel:WinStyle(WS_BORDER, .f.)
     oPanel:setcolor(CLR_WHITE,CLR_WHITE)


   For x = 1 to Len( aBtns )
      if x > 1
         if Mod( x, 5 ) = 1
            nRow += 200
            nCol := 10
         else
            nCol += 200
         endif
      endif
      @ nRow, nCol BTNBMP oBtn PROMPT aBtns[ x ][ 1 ]  ;
         RESOURCE aBtns[ x ][ 2 ] SIZE nW, nH PIXEL OF oPanel FLAT NOBORDER ;
         COLOR nClrText, nClrBack
         WITH OBJECT oBtn
            :bAction     := aBtns[ x ][ 3 ]
            :nClrBorder  := nClrBorder
            :bColorMap   := { | o | o:lBorder := o:lMOver, nCBorder }
            :oFontBold   := oBold
            :lRound      := .F.
         END
   Next x



















      oPanel:SetRange()

      RELEASE FONT oFont, oBold
 return oPanel
//----------------------------------------------------------------------------//
  //----------------------------------------------------------------------------//

static function Dummy()
Return nil

//----------------------------------------------------------------------------//
static function WndResize( oWnd )

   local oRect    := oWnd:GetCliRect()
   local nMargin, nRow, nCol, nCols, nBtnWidth, nBtns, nBtn, oBtn, n

   for n := 1 to 2
      oWnd:aControls[ n ]:nLeft := ( oRect:nWidth - oWnd:aControls[ n ]:nWidth ) / 2
   next

   nBtnWidth   := 200
   nCols       := Min( 5, Int( oRect:nWidth / nBtnWidth ) - 1 )
   nMargin     := ( oRect:nWidth - nCols * nBtnWidth ) / 2

   nBtns       := Len( oWnd:aControls ) - 2

   nRow        := 170
   nCol        := nMargin

   if nCols > 2
      for nBtn := 1 to nBtns
         WITH OBJECT ( oBtn := oWnd:aControls[ nBtn + 2 ] )
            :cCaption  := Trim( oBtn:cCaption )
            :nTop      := nRow
            :nLeft     := nCol
            :nWidth    := 200
            :nHeight   := 140
            :nLayOut   := LAYOUT_TOP
         END
         if nBtn % nCols == 0
            nRow  += 200
            nCol  := nMargin
         else
            nCol  += nBtnWidth
         endif
      next
   else
      for nBtn := 1 to nBtns
         WITH OBJECT ( oBtn := oWnd:aControls[ nBtn + 2 ] )
            :cCaption  += " "
            :nTop      := nRow
            :nLeft     := 30
            :nWidth    := oRect:nWidth - 60
            :nHeight   := 80
            :nLayOut   := LAYOUT_LEFT
         END
         nRow  += 100
      next
   endif

return nil

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


 

Re: oWnd:oClient := oPanel

Posted: Wed May 29, 2019 10:07 am
by Silvio.Falconi
New release

Image

Code: Select all

#include "FiveWin.ch"

static oDlg

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

function Main()

   Local oPanelScroll
   Local oFont1,oFontG
   Local oSay
   Local oGet
   local cFind      := ""
   local cPrompt    := "Setup of Windows ( FWH BtnBmp Demo )"


   DEFINE FONT oFont1 NAME "Segoe UI Light" SIZE 0,-24
 DEFINE FONT oFontG NAME "Segoe UI" SIZE 0,-18


 DEFINE DIALOG oDlg  SIZE 880,600 ;
PIXEL TRUEPIXEL RESIZABLE //FONT oFont

 oDlg:setcolor(CLR_BLACK,CLR_WHITE)

   @ 20, 160 SAY oSay PROMPT cPrompt OF oDlg PIXEL FONT oFont1 SIZE 420, 40
   @ 70, 170 GET oGet VAR    cFind   OF oDlg PIXEL FONT oFontG SIZE 400, 36
   *  CUEBANNER "Find a setting"

                 oSay:lTransparent:=.t.

oDlg:bResized := <||
local oRect := oDlg:GetCliRect()

oSay:nLeft := oRect:nLeft +160
oSay:nTop := oRect:ntop + 30

oGet:nLeft := oRect:nLeft +170
oGet:nTop := oRect:nTop + 70


RETURN nil
>

*/
ACTIVATE DIALOG oDlg CENTERED ;
 ON INIT( oPanelScroll := CreatePanel( oDlg,oGet ),;
          oPanelScroll:CheckResize(),;
          eval(oDlg:bResized)              )
return nil

//----------------------------------------------------------------------------//
    function CreatePanel( oDlg,oGet )
      local oPanel
     local oBold
     local aGrad  := { { 1, RGB( 216, 230, 238 ), RGB( 103, 154, 194 ) } }
     local aBtns    := { ;
                      { "System" + CRLF + "Screen, notifications," + CRLF + "power", 0xE770, { || Dummy() } }, ;
                      { "Devices" + CRLF + "Bluetooth, printers," + CRLF + "mouse", 0xE772, { || Dummy() } }, ;
                      { "Mobile" + CRLF + "Link your Android, iPhone" + CRLF, 0xE1C9, { || Dummy() } }, ;
                      { "Network && Internet" + CRLF + "WIFI, flight mode" + CRLF + "VPN", 0xE12b, { || Dummy() } }, ;
                      { "Personalization" + CRLF + "Background, lock screen" + CRLF, 0xE771, { || Dummy() } }, ;
                      { "Apps" + CRLF + "Uninstall defaults" + CRLF + "Optional Features", 0xE179, { || Dummy() } }, ;
                      { "Account" + CRLF + "Your account, email sync" + CRLF + "Work family", 0xE77B, { || Dummy() } }, ;
                      { "Time and language" + CRLF + "Voice, region, date" + CRLF, 0xE775, { || Dummy() } }, ;
                      { "Games" + CRLF + "Game bar, DVR," + CRLF + "retransmission and game mode", 0xE909, { || Dummy() } }, ;
                      { "Accessibility" + CRLF + "Narrator, magnifying glass," + CRLF + "high contrast", 0xE776, { || Dummy() } }, ;
                      { "Cortana" + CRLF + "Language of Cortana," + CRLF + "permissions, notifications", 0xECCA, { || Dummy() } }, ;
                      { "Privacy" + CRLF + "Location Camera" + CRLF, 0xE1F6, { || Dummy() } }, ;
                      { "Update && Security" + CRLF + "Windows Update" + CRLF + "Recovery", 0xE777, { || Dummy() } } ;
                     }

   local nRow       := 10
   local nCol       := 10
   local nClrBack   := CLR_WHITE
   local nW         := 200
   local nH         := 140
   local nCBorder   := 0xC38B2B
   local nClrText   := CLR_BLACK
   local nClrBorder := 0xE6E6E6

   DEFINE FONT oFont  NAME "Segoe UI" SIZE 0,-14

   DEFINE FONT oBold  NAME "Segoe UI" SIZE 0,-14 BOLD



     WITH OBJECT oGet
      :bAction       := { || Dummy() }
      :cBmpName      := 0xE11A
      :lBtnTransparent  := .t.
      :CreateButton()
   END




     oPanel   := TScrollPanel():New( 135,010,180,550,oDlg, .t. )
     oPanel:nRightMargin     := 2
     oPanel:nBottomMargin    := 5
     oPanel:WinStyle(WS_BORDER, .f.)
     oPanel:setcolor(CLR_WHITE,CLR_WHITE)


   For x = 1 to Len( aBtns )
      if x > 1
         if Mod( x, 5 ) = 1
            nRow += 200
            nCol := 10
         else
            nCol += 200
         endif
      endif
      @ nRow, nCol BTNBMP oBtn PROMPT aBtns[ x ][ 1 ]  ;
         RESOURCE aBtns[ x ][ 2 ] SIZE nW, nH PIXEL OF oPanel FLAT NOBORDER ;
         COLOR nClrText, nClrBack
         WITH OBJECT oBtn
            :bAction     := aBtns[ x ][ 3 ]
            :nClrBorder  := nClrBorder
            :bColorMap   := { | o | o:lBorder := o:lMOver, nCBorder }
            :oFontBold   := oBold
            :lRound      := .F.
         END
   Next x



















      oPanel:SetRange()

      RELEASE FONT oFont, oBold
 return oPanel
//----------------------------------------------------------------------------//
  //----------------------------------------------------------------------------//

static function Dummy()
Return nil

//----------------------------------------------------------------------------//
static function WndResize( oWnd )

   local oRect    := oWnd:GetCliRect()
   local nMargin, nRow, nCol, nCols, nBtnWidth, nBtns, nBtn, oBtn, n

   for n := 1 to 2
      oWnd:aControls[ n ]:nLeft := ( oRect:nWidth - oWnd:aControls[ n ]:nWidth ) / 2
   next

   nBtnWidth   := 200
   nCols       := Min( 5, Int( oRect:nWidth / nBtnWidth ) - 1 )
   nMargin     := ( oRect:nWidth - nCols * nBtnWidth ) / 2

   nBtns       := Len( oWnd:aControls ) - 2

   nRow        := 170
   nCol        := nMargin

   if nCols > 2
      for nBtn := 1 to nBtns
         WITH OBJECT ( oBtn := oWnd:aControls[ nBtn + 2 ] )
            :cCaption  := Trim( oBtn:cCaption )
            :nTop      := nRow
            :nLeft     := nCol
            :nWidth    := 200
            :nHeight   := 140
            :nLayOut   := LAYOUT_TOP
         END
         if nBtn % nCols == 0
            nRow  += 200
            nCol  := nMargin
         else
            nCol  += nBtnWidth
         endif
      next
   else
      for nBtn := 1 to nBtns
         WITH OBJECT ( oBtn := oWnd:aControls[ nBtn + 2 ] )
            :cCaption  += " "
            :nTop      := nRow
            :nLeft     := 30
            :nWidth    := oRect:nWidth - 60
            :nHeight   := 80
            :nLayOut   := LAYOUT_LEFT
         END
         nRow  += 100
      next
   endif

return nil

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


 

Re: oWnd:oClient := oPanel

Posted: Wed May 29, 2019 10:17 am
by Silvio.Falconi
Probable we can resize the arcontrols on Panel scroll , this can make you

Re: oWnd:oClient := oPanel

Posted: Wed May 29, 2019 10:26 am
by Otto
Hello Silvio,
thank you.
Now I understand the problem.
I am testing on a WINDOWS SERVER 2012 computer and here it is looking like this:
Do you know if there is a solution to get the same look as with WINDOWS 10 OS.
Best regards
Otto
Image

Re: oWnd:oClient := oPanel

Posted: Wed May 29, 2019 10:42 am
by Silvio.Falconi
Otto wrote:Hello Silvio,
thank you.
Now I understand the problem.
I am testing on a WINDOWS SERVER 2012 computer and here it is looking like this:
Do you know if there is a solution to get the same look as with WINDOWS 10 OS.
Best regards
Otto
How is the aspect of windows 10 os ?
do you have a snap to see
NOw I am at school and here I have win 7

Re: oWnd:oClient := oPanel

Posted: Wed May 29, 2019 11:03 am
by Silvio.Falconi
I try it on WINDOWS 10 pro 64 bit

Image

It seem the same ...

wich is the our dialog ?

only perhaps we must found a solution to insert border blu on get control as inwin10
and see how resize the control on scroll panel