oWnd:oClient := oPanel

Re: oWnd:oClient := oPanel

Postby Silvio.Falconi » Wed May 29, 2019 11:21 am

Now run good also in vertical

Image

Code: Select all  Expand view


#include "FiveWin.ch"
 #define LAYOUT_TOP     1
#define LAYOUT_LEFT    2
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()

WndResize( oPanelScroll,oSay,oGet,oRect)

RETURN nil
>

   oDlg:nWidth    := 850
   oDlg:nHeight   := 800



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,oSay,oGet,oRect1 )

   local oRect    := oWnd:GetCliRect()

   local nMargin, nRow, nCol, nCols, nBtnWidth, nBtns, nBtn, oBtn, n

   *for n := 1 to 2
      oSay:nLeft := ( oRect1:nWidth - oSay:nWidth ) / 2
      oGet:nLeft := ( oRect1:nWidth - oGet:nWidth ) / 2
   *next

   oSay:lTransparent:=.t.


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

   nBtns       := Len( oWnd:aControls )

   nRow        := 100
   nCol        := nMargin

   if nCols > 2
      for nBtn := 1 to nBtns
         WITH OBJECT ( oBtn := oWnd:aControls[ nBtn  ] )
            :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  ] )
            :cCaption  += " "
            :nTop      := nRow
            :nLeft     := 30
            :nWidth    := oRect:nWidth - 60
            :nHeight   := 80
            :nLayOut   := LAYOUT_LEFT
         END
         nRow  += 100
      next
   endif

   oWnd:refresh(.t.)

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

Re: oWnd:oClient := oPanel

Postby Silvio.Falconi » Wed May 29, 2019 11:26 am

sorry there was an error I update the message above
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: 7033
Joined: Thu Oct 18, 2012 7:17 pm

Re: oWnd:oClient := oPanel

Postby Otto » Wed May 29, 2019 12:02 pm

Hello Silvio,
now I changed registry.

HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics
To make your window borders as small as possible, double-click BorderWidth and set it to 0, and then double-click PaddedBoderWidth and set it to 0.

Here is the result:
Thank you and best regards
Otto
Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6312
Joined: Fri Oct 07, 2005 7:07 pm

Re: oWnd:oClient := oPanel

Postby Silvio.Falconi » Wed May 29, 2019 5:47 pm

perhaps is good not modify the registry of win10
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: 7033
Joined: Thu Oct 18, 2012 7:17 pm

Re: oWnd:oClient := oPanel

Postby Otto » Wed May 29, 2019 6:02 pm

Silvio,
on WINDOWS 10 all looks good - not so on WINDOWS SERVER 2012 R2.
Therefore I changed registry.
Thank you for your help
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6312
Joined: Fri Oct 07, 2005 7:07 pm

Re: oWnd:oClient := oPanel

Postby Silvio.Falconi » Wed May 29, 2019 8:24 pm

Otto wrote:Silvio,
on WINDOWS 10 all looks good - not so on WINDOWS SERVER 2012 R2.
Therefore I changed registry.
Thank you for your help
Otto


I cannnot try it on a windows server 2012 R2 I think I have also windows server 2003 at school but I must ask to my engineer who is in charge of the data processing center, I am only responsible for 2 computer labs as this : ( windows seven)

Image
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: 7033
Joined: Thu Oct 18, 2012 7:17 pm

Re: oWnd:oClient := oPanel

Postby ukoenig » Wed May 29, 2019 8:37 pm

My solution

no border and resizing of using a WINDOW

instead of a border for resizing there are 8 pixel defined on the right and bottom
between the panel and borders
for moving the windows there are 24 pixel on the top
The panel is resized as well
the second picture shows the hight resized.

Image

Image

regards
Uwe :D
Last edited by ukoenig on Sun Jun 02, 2019 6:46 pm, edited 2 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: oWnd:oClient := oPanel

Postby Otto » Wed May 29, 2019 8:57 pm

Hello Uwe,
would you be so kind to post your solution.
Thank you in advace
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6312
Joined: Fri Oct 07, 2005 7:07 pm

Re: oWnd:oClient := oPanel

Postby ukoenig » Thu May 30, 2019 6:52 am

Otto,

no problem.
What do You want to show on resizing :?:
resized images inside the panel as well
or keeping the original size
The same belongs to the top area
only adjusted ( centered ) or resized :?:

I think resizing from the top doesn't make sense
because the area is used for window-moving.
And from the left :?:

Because3 of NO border I'm using a defined area on right and bottom for resizing ( green ).

Image
Last edited by ukoenig on Fri May 31, 2019 10:31 am, edited 2 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: oWnd:oClient := oPanel

Postby Otto » Thu May 30, 2019 4:07 pm

Hello Uwe,
thanks for your offer.
it would be fine if you show for the moment how to move and resize the window.
Today is Ascension Day, that's why I did not work during the day.
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: 6312
Joined: Fri Oct 07, 2005 7:07 pm

Re: oWnd:oClient := oPanel

Postby ukoenig » Thu May 30, 2019 5:13 pm

Hello Otto,

the download ( full ) :

http://www.pflegeplus.com/DOWNLOADS/Panel1.zip

There are cursor-changes on the top, right and bottom-area
For resizing there is a defined space between the panel and the outline of the window
( the same effect like a defined border )
I would like to have a quiter refresh on resize, maybe possible :?:
Resized is defined from right and bottom. Top only for moving the window.
I think from left it doesn't make much sense.

regards
Uwe :D
Last edited by ukoenig on Fri May 31, 2019 12:13 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: oWnd:oClient := oPanel

Postby Otto » Thu May 30, 2019 6:39 pm

Hello Uwe,
thank you. This is exactly what I need.
There are still some problems with draging and resizing.
Please try.
Programm start - drag and then click inside the scrollbar. This does not work. You have to click on the Scroller then it works.
I can't resize bottom to a larger value.

In some cases if you want to drag the window to the left you have to position mouse cursor to the right side of the caption line.
Thank you for your work and 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: 6312
Joined: Fri Oct 07, 2005 7:07 pm

Re: oWnd:oClient := oPanel

Postby Silvio.Falconi » Fri May 31, 2019 7:30 am

Uwe,Otto

there are 3 problems

if you resize the window as this :

Image

and then press the middle button to resize maximized look the get and the say controls

Image

also i buttons are moved


then if resize as this :

Image

you cannot see the buttons as I made I (one down another and the controls say and get on middle of window)

see here https://i.postimg.cc/VNr0n2W1/vet.png


then there are dragging problems which is why I had used a DIALOG RESIZABLE and not a WINDOW

even if in theory a dialog... is the daughter of a window class
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: 7033
Joined: Thu Oct 18, 2012 7:17 pm

Re: oWnd:oClient := oPanel

Postby ukoenig » Fri May 31, 2019 10:33 am

I Changed from window to dialog :!:
now it works fine without problems like You can see the images resized and maximized.
I added some space between panel and border it is better for resizing

Otto wrote
There are still some problems with draging and resizing.
Please try.
Programm start - drag and then click inside the scrollbar.
This does not work. You have to click on the Scroller then it works.
I can't resize bottom to a larger value.
In some cases if you want to drag the window to the left you have
to position mouse cursor to the right side of the caption line.



Silvio wrote
you cannot see the buttons as I made I (one down another and the controls say and get on middle of window)


then there are dragging problems which is why I had used a DIALOG RESIZABLE and not a WINDOW

Image

Image

Image

regards
Uwe :D
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: oWnd:oClient := oPanel

Postby Otto » Fri May 31, 2019 11:59 am

Hallo Uwe,
soll ich das ZIP-file nochmals herunterladen.
Nochmals vielen Dank und liebe Grüße
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6312
Joined: Fri Oct 07, 2005 7:07 pm

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 40 guests