Page 1 of 1

Modify the title font of a MdiChild window

PostPosted: Thu Mar 14, 2024 1:53 pm
by Ari
Hello everybody !

I hope everything is ok!

Dear,

Is it possible to modify the title font of a MDIChild or Dialog window, increasing the size and style?

Re: Modify the title font of a MdiChild window

PostPosted: Thu Mar 14, 2024 2:19 pm
by karinha
NO.

Regards, saludos.

Re: Modify the title font of a MdiChild window

PostPosted: Fri Mar 15, 2024 1:46 am
by Otto
Hello Ari,

Have you seen this sample? It is for WINDOWS, but maybe you can change it to a dialog as well.

Best regards,
Otto

Image


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 TME_LEAVE    2

    function Main()

       local oWnd, nRowPos, nColPos, oBtnClose, oBtnMax, oBtnMin, lDrag := .F., oBold


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


       DEFINE WINDOW oWnd STYLE ( WS_POPUP | 0x00040000L  ) COLOR CLR_BLACK, CLR_MSPURPLE



       oWnd:SetSize( 500, 300 )
       oWnd:Center()
       oWnd:Shadow()

       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 ) }

oWnd:bPainted = { || oWnd:Say( 8, 30, "Caption", CLR_BLACK, CLR_WHITE, oBold, .T., .T. ) }
       ACTIVATE WINDOW oWnd

    return nil


 

Re: Modify the title font of a MdiChild window

PostPosted: Fri Mar 15, 2024 8:55 am
by Antonio Linares
Dear Ari,

Please review samples\skin3.prg

Re: Modify the title font of a MdiChild window

PostPosted: Fri Mar 15, 2024 3:04 pm
by karinha
My dear friend Otto, try this trick that you posted, using MDI, please.

Mi querido amigo Otto, prueba este truco que publicaste usando MDI, por favor.

Code: Select all  Expand view

   DEFINE WINDOW oWnd STYLE ( WS_POPUP | 0x00040000L  ) ;
      COLOR CLR_BLACK, CLR_MSPURPLE MDI
 


Gracias, tks.

Regards, saludos.