Buen día. ¿Es posible cambiar el color del título de la ventana? ¿Cómo en este ejemplo?
https://imgur.com/bDLVala
Regards, saludos.
#include "FiveWin.ch"
#define CLR_MSPURPLE RGB( 0, 120, 215 )
#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
#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 CLR_MSLIGHTGRAY RGB( 243, 243, 243 )
#define TME_LEAVE 2
#define _nClrPaneRB CLR_MSPURPLE
#define _nClrBoxOutRB CLR_MSLIGHTGRAY
#define _nClrBoxInRB CLR_MSLIGHTGRAY
#define _nClrBoxSelOut CLR_MSLIGHTGRAY
#define _aGradRB { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } }
#define _aGradHighRB { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } }
#define _aGradOverRB { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } }
function Main()
local oWnd, nRowPos, nColPos, oBtnClose, oBtnMax, oBtnMin, lDrag := .F.
local oRb
DEFINE WINDOW oWnd STYLE WS_POPUP COLOR CLR_BLACK, CLR_MSPURPLE
oWnd:SetSize( 1000, 500 )
oWnd:Shadow()
oWnd:Center()
oWnd:bLClicked = { | nRow, nCol | If( nRow < 25, ( oWnd:Capture(), nRowPos := nRow, nColPos := nCol, lDrag := .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. ),) }
oWnd:bLButtonUp = { || ReleaseCapture(), lDrag := .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 ), oRb:nWidth := oWnd:nWidth }
oRb = TRibbonBar():New( oWnd,,,,, 120, 40, _nClrPaneRB, _nClrBoxOutRB, _nClrBoxInRB,,;
_nClrBoxSelOut, _aGradRB,, _aGradHighRB, _aGradOverRB,,,,,.T.)
oWnd:oTop = nil
oRb:nTop = 30
oRb:nWidth = oWnd:nWidth
oRb:SetStyles( .F., .T. )
oRb:nClrPaneRB = CLR_MSPURPLE
oRb:hSeparation = 4
oRb:aGradFld = {|nOpt| iif( nOpt == oRb:nStart, { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } },;
{ { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } } ) }
oRb:Default()
AFill( oRb:aClrTabTxt, { | oSelf, nPrompt | If( nPrompt == oSelf:nOption, CLR_BLACK,;
If( oRb:nOverPrompt( ScreenToClient( oRb:hWnd, GetCursorPos() )[ 1 ],;
ScreenToClient( oRb:hWnd, GetCursorPos() )[ 2 ] ) == nPrompt, CLR_HRED, CLR_WHITE ) ) } )
oRb:AddGroup( 185, "First", 1 )
oRb:AddGroup( 185, "Second", 1 )
oRb:AddGroup( 185, "Third", 1 )
ACTIVATE WINDOW oWnd
return nil
leandro wrote:No se si te sirva
Es un ejemplo que publicaron en el foro
No logre encontrar el link
- Code: Select all Expand view
#include "FiveWin.ch"
#define CLR_MSPURPLE RGB( 0, 120, 215 )
#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
leandro wrote:Otro ejemplo
- Code: Select all Expand view
#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 CLR_MSLIGHTGRAY RGB( 243, 243, 243 )
#define TME_LEAVE 2
#define _nClrPaneRB CLR_MSPURPLE
#define _nClrBoxOutRB CLR_MSLIGHTGRAY
#define _nClrBoxInRB CLR_MSLIGHTGRAY
#define _nClrBoxSelOut CLR_MSLIGHTGRAY
#define _aGradRB { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } }
#define _aGradHighRB { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } }
#define _aGradOverRB { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } }
function Main()
local oWnd, nRowPos, nColPos, oBtnClose, oBtnMax, oBtnMin, lDrag := .F.
local oRb
DEFINE WINDOW oWnd STYLE WS_POPUP COLOR CLR_BLACK, CLR_MSPURPLE
oWnd:SetSize( 1000, 500 )
oWnd:Shadow()
oWnd:Center()
oWnd:bLClicked = { | nRow, nCol | If( nRow < 25, ( oWnd:Capture(), nRowPos := nRow, nColPos := nCol, lDrag := .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. ),) }
oWnd:bLButtonUp = { || ReleaseCapture(), lDrag := .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 ), oRb:nWidth := oWnd:nWidth }
oRb = TRibbonBar():New( oWnd,,,,, 120, 40, _nClrPaneRB, _nClrBoxOutRB, _nClrBoxInRB,,;
_nClrBoxSelOut, _aGradRB,, _aGradHighRB, _aGradOverRB,,,,,.T.)
oWnd:oTop = nil
oRb:nTop = 30
oRb:nWidth = oWnd:nWidth
oRb:SetStyles( .F., .T. )
oRb:nClrPaneRB = CLR_MSPURPLE
oRb:hSeparation = 4
oRb:aGradFld = {|nOpt| iif( nOpt == oRb:nStart, { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } },;
{ { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } } ) }
oRb:Default()
AFill( oRb:aClrTabTxt, { | oSelf, nPrompt | If( nPrompt == oSelf:nOption, CLR_BLACK,;
If( oRb:nOverPrompt( ScreenToClient( oRb:hWnd, GetCursorPos() )[ 1 ],;
ScreenToClient( oRb:hWnd, GetCursorPos() )[ 2 ] ) == nPrompt, CLR_HRED, CLR_WHITE ) ) } )
oRb:AddGroup( 185, "First", 1 )
oRb:AddGroup( 185, "Second", 1 )
oRb:AddGroup( 185, "Third", 1 )
ACTIVATE WINDOW oWnd
return nil
leandro wrote:Lo encontré, aquí esta el link del ejemplo publicado por Antonio
http://forums.fivetechsupport.com/viewtopic.php?f=3&t=37133&p=221803&hilit=caption+color&sid=044cd567d81e01c0080172a69aec34bd&sid=1dd75fb11fd670c9253dea41f6f1a6eb#p221803
// => \samples\GRABARIMG.PRG - 15/11/2021
#Include "FiveWin.ch"
#define CLR_MSPURPLE RGB( 0, 120, 215 )
#define CLR_MSRED RGB( 232, 17, 35 )
#define CLR_MSGRAY RGB( 229, 229, 229 )
#define TME_LEAVE 2
STATIC oWnd, hLib
FUNCTION Main()
LOCAL oBar, cTitle, cUrl, cSaveAs
LOCAL oWnd, nRowPos, nColPos, oBtnClose, oBtnMax, oBtnMin, lDrag := .F., ;
lRResize := .F., lBResize := .F.
SetBalloon( .T. )
SkinButtons()
// https://imgur.com/
cUrl := "https://i.imgur.com/UQxRdAp.png"
cSaveAs := "GrabaImg.png"
cTitle := "FiveWin Brasil: Grabar Imagen Desde URL"
DEFINE WINDOW oWnd TITLE cTitle
//DEFINE WINDOW oWnd STYLE WS_POPUP COLOR CLR_BLACK, CLR_MSPURPLE // MDI
//oWnd:SetSize( 500, 300 )
//oWnd:Center()
oWnd:Shadow()
oWnd:bPainted = { || oWnd:Say( 8, 30, "Caption Color", CLR_RED, 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 ) }
DEFINE BUTTONBAR oBar BUTTONSIZE 60, 50 _3DLOOK TOP OF oWnd 2007
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\floppy.bmp" FLAT ;
ACTION( URLDownLoad( cUrl, cSaveAs ) ) TOOLTIP "Saves this Image"
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\Exit.bmp" FLAT ;
ACTION oWnd:End() TOOLTIP "Exit this app" GROUP
SET MESSAGE OF oWnd TO cTitle NOINSET CLOCK DATE KEYBOARD 2007
// ON INIT( CLRTEST( CLR_WHITE, CLR_HRED ) ) ;
ACTIVATE WINDOW oWnd MAXIMIZED /* ;
ON PAINT( DiagonalGradientFill( hDC, ;
0, 0, oWnd:nHeight, oWnd:nWidth, ;
{ { 0.16, CLR_WHITE, CLR_CYAN }, ;
{ 0.16, CLR_CYAN, nRGB( 181, 61, 29 ) }, ;
{ 0.16, nRGB( 181, 61, 29 ), nRGB( 250,157,52 ) }, ;
{ 0.16, nRGB( 250,157,52 ), nRGB( 181, 61, 29 ) }, ;
{ 0.16, nRGB( 181, 61, 29 ), CLR_CYAN }, ;
{ 0.20, CLR_CYAN, CLR_WHITE } },.T. ), PINTA( hDC ) )
*/
RETURN NIL
FUNCTION URLDownLoad( cUrl, cSaveAs )
hLib := LOADLIBRARY( "urlmon.dll" )
CURSORWAIT()
IF FILE( cSaveAs )
ERASE cSaveAs
ENDIF
IF .NOT. URLDownloadToFile( 0, cUrl, cSaveAs, 0, 0 ) == 0
MsgInfo( "Image Not Found in: https://imgur.com/", "Attention!" )
RETURN( .F. )
ENDIF
FreeLibrary( hLib )
CURSORARROW()
ShellExecute(GetActiveWindow(),"open",'"'+cSaveAs+'"')
RETURN( .T. )
FUNCTION DiagonalGradientFill( hDC, nTop, nLeft, nBottom, nRight, aGradInfo, ;
lDirection )
LOCAL nClr := 1, nClrs := Len( aGradInfo )
LOCAL nSize, nStart, nEnd
DEFAULT lDirection := .T.
IF Empty( aGradInfo )
RETURN NIL
ENDIF
nSize = ( nBottom - nTop ) + ( nRight - nLeft )
nStart = 0
nEnd = 0
FOR nClr := 1 to nClrs
nStart = nEnd
nEnd += ( nSize * ( aGradInfo[ nClr ][ 1 ] ) )
DiagonalGradient( hDC, ;
{ nTop, nLeft, nBottom, nRight },;
aGradInfo[ nClr ][ 2 ], ;
aGradInfo[ nClr ][ 3 ], ;
lDirection, ;
nStart, ;
nEnd )
NEXT
RETURN NIL
FUNCTION Pinta( hDC )
LOCAL nColor
LOCAL nLeft := 80
LOCAL nRight := 220
LOCAL cTexto := "FIVEWIN BRASIL THE BEST"
LOCAL cTexto2 := "No funciona... "
LOCAL oFont
LOCAL hFont
LOCAL nLen := LEN( cTexto )
LOCAL cLetra, n
LOCAL nResHoriz, nResVert
nResHoriz := oWnd:nHorzRes() // retorna a resolucao horizontal
nResVert := oWnd:nVertRes() // retorna a resolucao vertical
// atencao: nResolution identifica em que resolucao foram inicialmente
// desenhadas as telas, e DEVE ter um dos seguintes valores:
//
// 1 = 640 X 480
// 2 = 800 X 600
// 3 = 1024 X 768
// 4 = 1152 X 864
// 5 = 1280 X 800
// 6 = 1280 X 1024
// 7 = 1600 X 1200
// 8 = 768 X 1024
// 9 = 1440 X 900
// 10 = 1280 X 768
// 11 = 1280 X 720
IF nResHoriz = 1366 .AND. nResVert = 768
nLeft := 260
nRight := 230
ELSEIF nResHoriz = 1360 .AND. nResVert = 768
nLeft := 210
nRight := 250
ELSEIF nResHoriz = 1280 .AND. nResVert = 1024
nLeft := 210
nRight := 350
ELSEIF nResHoriz = 1280 .AND. nResVert = 768
nLeft := 170 // 210 // my computer.
nRight := 280
ELSEIF nResHoriz = 1280 .AND. nResVert = 720
nLeft := 200
nRight := 200
ELSEIF nResHoriz = 1024 .AND. nResVert = 768
nLeft := 80
nRight := 220
ELSE
nLeft := 80
nRight := 220
ENDIF
DEFINE FONT oFont NAME "Segoe UI Symbol" SIZE 0, -80 BOLD
hFont := SelectObject( hDC, oFont:hFont )
FOR n := 1 TO nLen
cLetra := substr( cTexto, n, 1 )
nColor := SetTextColor( hDC, CLR_GREEN )
// TextOut( hDC, 10, nLeft, cLetra )
TextOut( hDC, nRight, nLeft, cLetra )
SetTextColor( hDC, nColor )
nLeft += GetTextWidth( hDC, cLetra, oFont )
NEXT
SelectObject( hDC, hFont )
RETURN NIL
#pragma BEGINDUMP
#include <hbapi.h>
#include <windows.h>
HB_FUNC( CLRTEST )
{
int aElements[2] = { COLOR_CAPTIONTEXT, COLOR_ACTIVECAPTION };
DWORD aColors[2];
aColors[ 0 ] = hb_parnl( 1 );
aColors[ 1 ] = hb_parnl( 2 );
SetSysColors( 2, aElements, aColors );
}
#pragma ENDDUMP
DLL32 FUNCTION URLDownloadToFile( pCaller AS LONG, szURL AS STRING, szFileName ;
AS STRING, dwReserved AS LONG, lpfnCB AS LONG ) AS LONG PASCAL ;
FROM "URLDownloadToFileA" LIB hlib
// fin /end
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: Google [Bot] and 38 guests