User defined Windows captions
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: User defined Windows captions
Antonio,
OK, that works great, except that I just found that a window STYLE WS_POPUP is not resizable. That is a show stopper, at least for me.
Ah, now I see that STYLE WS_POPUP doesn't even actually have a caption bar. The one you are using is made by smoke and mirrors. Nothing wrong with that, but we need a fully functional, resizable, window with a real caption bar for our apps using a ribbonbar. Somehow Microsoft has done this, we just have to find out how.
I did just find this: https://docs.microsoft.com/en-us/window ... /title-bar
I am not familiar with XAML, so I don't know if it might be helpful.
James
OK, that works great, except that I just found that a window STYLE WS_POPUP is not resizable. That is a show stopper, at least for me.
Ah, now I see that STYLE WS_POPUP doesn't even actually have a caption bar. The one you are using is made by smoke and mirrors. Nothing wrong with that, but we need a fully functional, resizable, window with a real caption bar for our apps using a ribbonbar. Somehow Microsoft has done this, we just have to find out how.
I did just find this: https://docs.microsoft.com/en-us/window ... /title-bar
I am not familiar with XAML, so I don't know if it might be helpful.
James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
- Antonio Linares
- Site Admin
- Posts: 37485
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: User defined Windows captions
James,
Here we have right resize support:
Here we have right resize support:
Code: Select all
#include "FiveWin.ch"
#define CLR_MSPURPLE RGB( 128, 57, 123 )
#define CLR_MSRED RGB( 232, 17, 35 )
#define CLR_MSGRAY RGB( 229, 229, 229 )
#define TME_LEAVE 2
function Main()
local oWnd, nRowPos, nColPos, oBtnClose, oBtnMax, oBtnMin, lDrag := .F., lRResize := .F.
DEFINE WINDOW oWnd STYLE WS_POPUP COLOR CLR_BLACK, CLR_MSPURPLE
oWnd:SetSize( 500, 300 )
oWnd:Center()
oWnd:Shadow()
oWnd:bPainted = { || oWnd:Say( 8, 30, "Caption", CLR_WHITE, CLR_MSPURPLE, oWnd:oFont, .T., .T. ) }
oWnd:bLClicked = { | nRow, nCol | If( nRow < 25, ( oWnd:Capture(), nRowPos := nRow, nColPos := nCol, lDrag := .T. ),),;
If( nRow > 25 .and. nCol > oWnd:nWidth - 25, ( oWnd:Capture(), nRowPos := nRow, nColPos := nCol, lRResize := .T. ),) }
oWnd:bMMoved = { | nRow, nCol | TrackMouseEvent( oWnd:hWnd, TME_LEAVE ),;
If( lDrag .and. ! IsZoomed( oWnd:hWnd ) .and. IsOverWnd( oWnd:hWnd, nRow, nCol ),;
oWnd:Move( oWnd:nTop + nRow - nRowPos, oWnd:nLeft + nCol - nColPos,,, .T. ),),;
If( lRResize .and. ! IsZoomed( oWnd:hWnd ) .and. IsOverWnd( oWnd:hWnd, nRow, nCol ),;
( oWnd:SetSize( oWnd:nWidth + nCol - nColPos, oWnd:nHeight, .T. ), nColPos := nCol ),) }
oWnd:bLButtonUp = { || ReleaseCapture(), lDrag := .F., lRResize := .F. }
oWnd:bMLeave = { || lDrag := .F. }
@ 1, oWnd:nWidth - 46 BTNBMP oBtnClose BITMAP "../bitmaps/16x16/closew.bmp" ;
FLAT NOBORDER NOROUND ACTION oWnd:End() SIZE 45, 29 ;
COLOR CLR_BLACK, CLR_MSPURPLE
@ 1, oWnd:nWidth - 92 BTNBMP oBtnMax BITMAP "../bitmaps/16x16/max.bmp" ;
FLAT NOBORDER NOROUND ACTION If( ! IsZoomed( oWnd:hWnd ), oWnd:Maximize(), oWnd:Restore() ) SIZE 45, 29 ;
COLOR CLR_BLACK, CLR_MSPURPLE
@ 1, oWnd:nWidth - 138 BTNBMP oBtnMin BITMAP "../bitmaps/16x16/min.bmp" ;
FLAT NOBORDER NOROUND ACTION If( ! IsIconic( oWnd:hWnd ), oWnd:Iconize(), oWnd:Restore() ) SIZE 45, 29 ;
COLOR CLR_BLACK, CLR_MSPURPLE
oBtnClose:bMMoved = { || oBtnClose:SetColor( CLR_BLACK, If( oBtnClose:lMOver, CLR_MSRED, oWnd:nClrPane ) ) }
oBtnMax:bMMoved = { || oBtnMax:SetColor( CLR_BLACK, If( oBtnMax:lMOver, CLR_MSGRAY, oWnd:nClrPane ) ) }
oBtnMin:bMMoved = { || oBtnMin:SetColor( CLR_BLACK, If( oBtnMin:lMOver, CLR_MSGRAY, oWnd:nClrPane ) ) }
oWnd:bResized = { || oBtnClose:Move( 1, oWnd:nWidth - 46 ), oBtnMax:Move( 1, oWnd:nWidth - 92 ),;
oBtnMin:Move( 1, oWnd:nWidth - 138 ) }
ACTIVATE WINDOW oWnd
return nil
- Antonio Linares
- Site Admin
- Posts: 37485
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: User defined Windows captions
Here we have right and bottom resize support:
Code: Select all
#include "FiveWin.ch"
#define CLR_MSPURPLE RGB( 128, 57, 123 )
#define CLR_MSRED RGB( 232, 17, 35 )
#define CLR_MSGRAY RGB( 229, 229, 229 )
#define TME_LEAVE 2
function Main()
local oWnd, nRowPos, nColPos, oBtnClose, oBtnMax, oBtnMin, lDrag := .F., lRResize := .F., lBResize := .F.
DEFINE WINDOW oWnd STYLE WS_POPUP COLOR CLR_BLACK, CLR_MSPURPLE
oWnd:SetSize( 500, 300 )
oWnd:Center()
oWnd:Shadow()
oWnd:bPainted = { || oWnd:Say( 8, 30, "Caption", CLR_WHITE, CLR_MSPURPLE, oWnd:oFont, .T., .T. ) }
oWnd:bLClicked = { | nRow, nCol | If( nRow < 25, ( oWnd:Capture(), nRowPos := nRow, nColPos := nCol, lDrag := .T. ),),;
If( nRow > 25 .and. nCol > oWnd:nWidth - 25, ( oWnd:Capture(), nRowPos := nRow, nColPos := nCol, lRResize := .T. ),),;
If( nRow > 25 .and. nRow > oWnd:nHeight - 25, ( oWnd:Capture(), nRowPos := nRow, nColPos := nCol, lBResize := .T. ),) }
oWnd:bMMoved = { | nRow, nCol | TrackMouseEvent( oWnd:hWnd, TME_LEAVE ),;
If( lDrag .and. ! IsZoomed( oWnd:hWnd ) .and. IsOverWnd( oWnd:hWnd, nRow, nCol ),;
oWnd:Move( oWnd:nTop + nRow - nRowPos, oWnd:nLeft + nCol - nColPos,,, .T. ),),;
If( lRResize .and. ! IsZoomed( oWnd:hWnd ) .and. IsOverWnd( oWnd:hWnd, nRow, nCol ),;
( oWnd:SetSize( oWnd:nWidth + nCol - nColPos, oWnd:nHeight, .T. ), nColPos := nCol ),),;
If( lBResize .and. ! IsZoomed( oWnd:hWnd ) .and. IsOverWnd( oWnd:hWnd, nRow, nCol ),;
( oWnd:SetSize( oWnd:nWidth, oWnd:nHeight + nRow - nRowPos, .T. ), nRowPos := nRow ),) }
oWnd:bLButtonUp = { || ReleaseCapture(), lDrag := .F., lRResize := .F., lBResize := .F. }
oWnd:bMLeave = { || lDrag := .F. }
@ 1, oWnd:nWidth - 46 BTNBMP oBtnClose BITMAP "../bitmaps/16x16/closew.bmp" ;
FLAT NOBORDER NOROUND ACTION oWnd:End() SIZE 45, 29 ;
COLOR CLR_BLACK, CLR_MSPURPLE
@ 1, oWnd:nWidth - 92 BTNBMP oBtnMax BITMAP "../bitmaps/16x16/max.bmp" ;
FLAT NOBORDER NOROUND ACTION If( ! IsZoomed( oWnd:hWnd ), oWnd:Maximize(), oWnd:Restore() ) SIZE 45, 29 ;
COLOR CLR_BLACK, CLR_MSPURPLE
@ 1, oWnd:nWidth - 138 BTNBMP oBtnMin BITMAP "../bitmaps/16x16/min.bmp" ;
FLAT NOBORDER NOROUND ACTION If( ! IsIconic( oWnd:hWnd ), oWnd:Iconize(), oWnd:Restore() ) SIZE 45, 29 ;
COLOR CLR_BLACK, CLR_MSPURPLE
oBtnClose:bMMoved = { || oBtnClose:SetColor( CLR_BLACK, If( oBtnClose:lMOver, CLR_MSRED, oWnd:nClrPane ) ) }
oBtnMax:bMMoved = { || oBtnMax:SetColor( CLR_BLACK, If( oBtnMax:lMOver, CLR_MSGRAY, oWnd:nClrPane ) ) }
oBtnMin:bMMoved = { || oBtnMin:SetColor( CLR_BLACK, If( oBtnMin:lMOver, CLR_MSGRAY, oWnd:nClrPane ) ) }
oWnd:bResized = { || oBtnClose:Move( 1, oWnd:nWidth - 46 ), oBtnMax:Move( 1, oWnd:nWidth - 92 ),;
oBtnMin:Move( 1, oWnd:nWidth - 138 ) }
ACTIVATE WINDOW oWnd
return nil
Re: User defined Windows captions
Antonio,
thank You very much.
With Your solution It is easy to do a zoom / unzoom of image-groups inside a window
It is A GDIPLUS-solution
calculated : zoomlevel of images, top / left space, space between images
On top I displayed the new wnd-size and the calculated zoom-factor
It works as well for horizontal and vertical zoom.
The used window-system-images are added at the bottom




System-images



regards
Uwe
thank You very much.
With Your solution It is easy to do a zoom / unzoom of image-groups inside a window
It is A GDIPLUS-solution
calculated : zoomlevel of images, top / left space, space between images
On top I displayed the new wnd-size and the calculated zoom-factor
It works as well for horizontal and vertical zoom.
The used window-system-images are added at the bottom




System-images



Code: Select all
#include "FiveWin.ch"
#define CLR_MSPURPLE RGB( 128, 57, 123 )
#define CLR_MSRED RGB( 232, 17, 35 )
#define CLR_MSGRAY RGB( 229, 229, 229 )
#define TME_LEAVE 2
STATIC c_path, c_path1
FUNCTION MAIN()
LOCAL oWnd, nRowPos, nColPos, oBtnClose, oBtnMax, oBtnMin, lDrag := .F., lRResize := .F., lBResize := .F.
LOCAL nWidth := 500, nNewWidth := 500, nHeight := 300, nNewHeight := 300
LOCAL nFactorW := 1, nFactorH := 1, lWZoomed
LOCAL nImgRow := 40, nImgCol := 40
LOCAL nImgSpace := 16, nLeftPos, nRightPos
c_path := cFilePath(GetModuleFileName( GetInstance() ) )
c_path1 := c_path + "BITMAPS\"
DEFINE WINDOW oWnd STYLE WS_POPUP COLOR CLR_BLACK, CLR_MSPURPLE
oWnd:SetSize( nWidth, nHeight )
oWnd:Center()
oWnd:Shadow()
oWnd:bPainted = { || oWnd:Say( 8, 30, "Caption", CLR_WHITE, CLR_MSPURPLE, oWnd:oFont, .T., .T. ) }
oWnd:bPainted := { || oWnd:Say( 8, 30, "Width - Factor : " + ALLTRIM(STR( nNewWidth )) + " = " + ALLTRIM(STR( nFactorW )) + ;
" Height - Factor : " + ALLTRIM(STR( nNewHeight )) + " = " + ALLTRIM(STR( nFactorH )) + ;
" ( " + ALLTRIM(STR( nWidth )) + " x " + ALLTRIM(STR( nHeight )) + " ) ", ;
CLR_WHITE, CLR_MSPURPLE, oWnd:oFont, .T., .T. ), ;
SHOW_IMG( oWnd, nImgRow, nImgCol, nImgSpace, nFactorW, nFactorH, lWZoomed ) }
oWnd:bLClicked = { | nRow, nCol | If( nRow < 25, ( oWnd:Capture(), nRowPos := nRow, nColPos := nCol, lDrag := .T. ),),;
If( nRow > 25 .and. nCol > oWnd:nWidth - 25, ( oWnd:Capture(), nRowPos := nRow, nColPos := nCol, lRResize := .T. ),),;
If( nRow > 25 .and. nRow > oWnd:nHeight - 25, ( oWnd:Capture(), nRowPos := nRow, nColPos := nCol, lBResize := .T. ),) }
oWnd:bMMoved = { | nRow, nCol | TrackMouseEvent( oWnd:hWnd, TME_LEAVE ),;
If( lDrag .and. ! IsZoomed( oWnd:hWnd ) .and. IsOverWnd( oWnd:hWnd, nRow, nCol ),;
oWnd:Move( oWnd:nTop + nRow - nRowPos, oWnd:nLeft + nCol - nColPos,,, .T. ),),;
If( lRResize .and. ! IsZoomed( oWnd:hWnd ) .and. IsOverWnd( oWnd:hWnd, nRow, nCol ),; // width
( oWnd:SetSize( oWnd:nWidth + nCol - nColPos, oWnd:nHeight, .T. ), nColPos := nCol,;
nNewWidth := oWnd:nWidth(), nFactorW := nNewWidth / nWidth, lWZoomed := .T. ),),;
If( lBResize .and. ! IsZoomed( oWnd:hWnd ) .and. IsOverWnd( oWnd:hWnd, nRow, nCol ),; // height
( oWnd:SetSize( oWnd:nWidth, oWnd:nHeight + nRow - nRowPos, .T. ), nRowPos := nRow,;
nNewHeight := oWnd:nHeight(), nFactorH := nNewHeight / nHeight, lWZoomed := .F. ),) }
oWnd:bLButtonUp = { || ReleaseCapture(), lDrag := .F., lRResize := .F., lBResize := .F. }
oWnd:bMLeave = { || lDrag := .F. }
@ 1, oWnd:nWidth - 46 BTNBMP oBtnClose BITMAP c_path1 + "closew.png" ;
FLAT NOBORDER NOROUND ACTION oWnd:End() SIZE 32, 32 ;
COLOR CLR_BLACK, CLR_MSPURPLE
@ 1, oWnd:nWidth - 92 BTNBMP oBtnMax BITMAP c_path1 + "max.png" ;
FLAT NOBORDER NOROUND ACTION If( ! IsZoomed( oWnd:hWnd ), oWnd:Maximize(), oWnd:Restore() ) SIZE 32, 32 ;
COLOR CLR_BLACK, CLR_MSPURPLE
@ 1, oWnd:nWidth - 138 BTNBMP oBtnMin BITMAP c_path1 + "min.png" ;
FLAT NOBORDER NOROUND ACTION If( ! IsIconic( oWnd:hWnd ), oWnd:Iconize(), oWnd:Restore() ) SIZE 32, 32 ;
COLOR CLR_BLACK, CLR_MSPURPLE
oBtnClose:bMMoved = { || oBtnClose:SetColor( CLR_BLACK, If( oBtnClose:lMOver, CLR_MSRED, oWnd:nClrPane ) ) }
oBtnMax:bMMoved = { || oBtnMax:SetColor( CLR_BLACK, If( oBtnMax:lMOver, CLR_MSGRAY, oWnd:nClrPane ) ) }
oBtnMin:bMMoved = { || oBtnMin:SetColor( CLR_BLACK, If( oBtnMin:lMOver, CLR_MSGRAY, oWnd:nClrPane ) ) }
oWnd:bResized = { || oBtnClose:Move( 1, oWnd:nWidth - 45 ), oBtnMax:Move( 1, oWnd:nWidth - 75 ),;
oBtnMin:Move( 1, oWnd:nWidth - 105 ) }
ACTIVATE WINDOW oWnd
RETURN NIL
// --------------------
FUNCTION SHOW_IMG( oWnd, nImgRow, nImgCol, nImgSpace, nFactorW, nFactorH, lWZoomed )
LOCAL oGraphics := Graphics():New( oWnd:hDC )
LOCAL oImage := GDIBmp():New( c_path1 + "Olga.jpg" )
LOCAL nTop, nLeft
LOCAL nWidth := oImage:GetWidth(), nHeight := oImage:GetHeight(), nSpace := 1
LOCAL nFactor := nFactorW
IF lWZoomed = .F. // vertical resize selected
nFactor := nFactorH
ENDIF
nTop := nImgRow * nFactor
nLeft := nImgCol * nFactor
nSpace := nImgSpace * nFactor
// 1. Image
oGraphics:DrawImage( oImage, nTop, nLeft, nWidth * nFactor, nHeight * nFactor )
nImgCol := oImage:GetWidth() + nSpace
nTop := nImgRow * nFactor
nLeft := nLeft + nSpace + ( nWidth * nFactor )
oGraphics:destroy()
// 2. Image
oGraphics := Graphics():New( oWnd:hDC )
oGraphics:DrawImage( oImage, nTop, nLeft, nWidth * nFactor, nHeight * nFactor )
oGraphics:destroy()
RETURN NIL
Uwe

Last edited by ukoenig on Mon May 13, 2019 6:45 pm, edited 7 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.
i work with FW.
If you have any questions about special functions, maybe i can help.
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: User defined Windows captions
Uwe,
with 2 images can be easy
try with 800 btnbmp 40X20 on a Tscrolpanel
with 2 images can be easy
try with 800 btnbmp 40X20 on a Tscrolpanel
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
- Antonio Linares
- Site Admin
- Posts: 37485
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: User defined Windows captions
Dear Uwe,
Could you please provide the images the most similar possible to Windows 10 ones ? They seem to fit in 16x16 pixels
Black and white also
many thanks
Could you please provide the images the most similar possible to Windows 10 ones ? They seem to fit in 16x16 pixels
Black and white also
many thanks
Re: User defined Windows captions
Dear Antonio,
in case the lines are to heavy I can make them a little bit smaller
now it looks the same like the windows-systembuttons
do You want the vertical lines between the buttons as well ( added ) ?
I changed the close-button-color on caption

System-images



smaller lines



NO vertical lines






New button-values used
regards
Uwe
to small 45 x 24 usedThey seem to fit in 16x16 pixels
in case the lines are to heavy I can make them a little bit smaller
now it looks the same like the windows-systembuttons
do You want the vertical lines between the buttons as well ( added ) ?
I changed the close-button-color on caption

System-images



smaller lines




NO vertical lines







New button-values used

Code: Select all
FUNCTION MAIN()
LOCAL oWnd, nRowPos, nColPos, oBtnClose, oBtnMax, oBtnMin, lDrag := .F., lRResize := .F., lBResize := .F.
LOCAL nWidth := 500, nNewWidth := 500, nHeight := 300, nNewHeight := 300
LOCAL nFactorW := 1, nFactorH := 1, lWZoomed
LOCAL nImgRow := 40, nImgCol := 40
LOCAL nImgSpace := 16, nLeftPos, nRightPos
c_path := cFilePath(GetModuleFileName( GetInstance() ) )
c_path1 := c_path + "BITMAPS\"
DEFINE WINDOW oWnd STYLE WS_POPUP COLOR CLR_BLACK, CLR_MSPURPLE
oWnd:SetSize( nWidth, nHeight )
oWnd:Center()
oWnd:Shadow()
oWnd:bPainted := { || oWnd:Say( 8, 10, "Width - Factor : " + ALLTRIM(STR( nNewWidth )) + " = " + ALLTRIM(STR( nFactorW )) + ;
" Height - Factor : " + ALLTRIM(STR( nNewHeight )) + " = " + ALLTRIM(STR( nFactorH )) + ;
" ( " + ALLTRIM(STR( nWidth )) + " x " + ALLTRIM(STR( nHeight )) + " ) ", ;
CLR_WHITE, CLR_MSPURPLE, oWnd:oFont, .T., .T. ), ;
SHOW_IMG( oWnd, nImgRow, nImgCol, nImgSpace, nFactorW, nFactorH, lWZoomed ) }
oWnd:bLClicked = { | nRow, nCol | If( nRow < 25, ( oWnd:Capture(), nRowPos := nRow, nColPos := nCol, lDrag := .T. ),),;
If( nRow > 25 .and. nCol > oWnd:nWidth - 25, ( oWnd:Capture(), nRowPos := nRow, nColPos := nCol, lRResize := .T. ),),;
If( nRow > 25 .and. nRow > oWnd:nHeight - 25, ( oWnd:Capture(), nRowPos := nRow, nColPos := nCol, lBResize := .T. ),) }
oWnd:bMMoved = { | nRow, nCol | TrackMouseEvent( oWnd:hWnd, TME_LEAVE ),;
If( lDrag .and. ! IsZoomed( oWnd:hWnd ) .and. IsOverWnd( oWnd:hWnd, nRow, nCol ),;
oWnd:Move( oWnd:nTop + nRow - nRowPos, oWnd:nLeft + nCol - nColPos,,, .T. ),),;
If( lRResize .and. ! IsZoomed( oWnd:hWnd ) .and. IsOverWnd( oWnd:hWnd, nRow, nCol ),; // width
( oWnd:SetSize( oWnd:nWidth + nCol - nColPos, oWnd:nHeight, .T. ), nColPos := nCol,;
nNewWidth := oWnd:nWidth(), nFactorW := nNewWidth / nWidth, lWZoomed := .T. ),),;
If( lBResize .and. ! IsZoomed( oWnd:hWnd ) .and. IsOverWnd( oWnd:hWnd, nRow, nCol ),; // height
( oWnd:SetSize( oWnd:nWidth, oWnd:nHeight + nRow - nRowPos, .T. ), nRowPos := nRow,;
nNewHeight := oWnd:nHeight(), nFactorH := nNewHeight / nHeight, lWZoomed := .F. ),) }
oWnd:bLButtonUp = { || ReleaseCapture(), lDrag := .F., lRResize := .F., lBResize := .F. }
oWnd:bMLeave = { || lDrag := .F. }
@ 1, oWnd:nWidth - 140 BTNBMP oBtnMin BITMAP c_path1 + "min.png" ;
FLAT NOBORDER NOROUND ACTION If( ! IsIconic( oWnd:hWnd ), oWnd:Iconize(), oWnd:Restore() ) SIZE 45, 24 ;
COLOR CLR_BLACK, CLR_MSPURPLE
@ 1, oWnd:nWidth - 95 BTNBMP oBtnMax BITMAP c_path1 + "max.png" ;
FLAT NOBORDER NOROUND ACTION If( ! IsZoomed( oWnd:hWnd ), oWnd:Maximize(), oWnd:Restore() ) SIZE 45, 24 ;
COLOR CLR_BLACK, CLR_MSPURPLE
@ 1, oWnd:nWidth - 50 BTNBMP oBtnClose BITMAP c_path1 + "closew.png" ;
FLAT NOBORDER NOROUND ACTION oWnd:End() SIZE 45, 24 ;
COLOR CLR_BLACK, CLR_MSPURPLE
oBtnMin:bMMoved = { || oBtnMin:SetColor( CLR_BLACK, If( oBtnMin:lMOver, CLR_MSGRAY, oWnd:nClrPane ) ) }
oBtnMax:bMMoved = { || oBtnMax:SetColor( CLR_BLACK, If( oBtnMax:lMOver, CLR_MSGRAY, oWnd:nClrPane ) ) }
oBtnClose:bMMoved = { || oBtnClose:SetColor( CLR_BLACK, If( oBtnClose:lMOver, nRGB( 236, 108, 96 ) , oWnd:nClrPane ) ) }
oWnd:bResized = { || oBtnMin:Move( 1, oWnd:nWidth - 140 ), oBtnMax:Move( 1, oWnd:nWidth - 95 ),;
oBtnClose:Move( 1, oWnd:nWidth - 50 ) }
ACTIVATE WINDOW oWnd
RETURN NIL
Uwe

Last edited by ukoenig on Tue May 14, 2019 9:17 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.
i work with FW.
If you have any questions about special functions, maybe i can help.
- Antonio Linares
- Site Admin
- Posts: 37485
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: User defined Windows captions
many year ago I made a game ...game finds the differences for children and for adults
and this dialog with two image, reminded me of this game
if I can find it, I send it to you
I remember that I had made so many images for Garombo Ugo's baby
and every week he had fun with my game
and this dialog with two image, reminded me of this game
if I can find it, I send it to you
I remember that I had made so many images for Garombo Ugo's baby
and every week he had fun with my game
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Re: User defined Windows captions
The calculation of a image-matrix
resized in both directions

regards
Uwe
resized in both directions

Code: Select all
FUNCTION SHOW_IMG( oWnd, nImgRow, nImgCol, nImgSpace, nFactorW, nFactorH, lWZoomed )
LOCAL oGraphics := Graphics():New( oWnd:hDC )
LOCAL oImage := GDIBmp():New( c_path1 + "Olga.jpg" )
LOCAL nTop, nLeft
LOCAL nWidth := oImage:GetWidth(), nHeight := oImage:GetHeight(), nSpace := 1
LOCAL nFactor := nFactorW
IF lWZoomed = .F. // vertical resize selected
nFactor := nFactorH
ENDIF
nTop := nImgRow * nFactor // start-position top
nLeft := nImgCol * nFactor // start-position left
nOrgLeft := nImgCol * nFactor // reset to left on new row
nSpace := nImgSpace * nFactor // zoomed space between images
I := 1
X := 0
FOR I := 1 TO 8 // 2 rows with 8 images
X++
oGraphics:DrawImage( oImage, nTop, nLeft, ; // image draw
nWidth * nFactor, nHeight * nFactor )
nImgCol := oImage:GetWidth() + nSpace // new col-pos each image horizontal
nLeft += nSpace + ( nWidth * nFactor ) // next image left position
oGraphics:destroy()
oGraphics := Graphics():New( oWnd:hDC )
IF X = 4 // break after 4 images each row
nTop += nHeight * nFactor + nSpace // next row-position
nLeft := nOrgLeft
X := 0
ENDIF
NEXT
RETURN NIL
Uwe

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.
i work with FW.
If you have any questions about special functions, maybe i can help.
Re: User defined Windows captions
I created a new example with a included panel ( added to my sample-collection )
using the basics with some extensions
I'm still waiting for Otto's answer if he likes to resize the panel-images as well.
The top-lines are centered on resize.
there are cursorchanges added
on top the cursor changes from normal to CursorCatch() and on right and bottom ( resize )
to CursorSize()

regards
Uwe
using the basics with some extensions
I'm still waiting for Otto's answer if he likes to resize the panel-images as well.
The top-lines are centered on resize.
there are cursorchanges added
on top the cursor changes from normal to CursorCatch() and on right and bottom ( resize )
to CursorSize()

regards
Uwe

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.
i work with FW.
If you have any questions about special functions, maybe i can help.