Hello,
is it possible to have oWnd:oClient := oPanel in combination with
oPanel:nTop := 20
Thank you in advance
Otto
But there is another problem. It seems we can't make resizeable windows without a border.
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 }
#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
//----------------------------------------------------------------------------//
#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
//----------------------------------------------------------------------------//
#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
//----------------------------------------------------------------------------//
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
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 52 guests