I wonder if it is possible to use bold or italic characters in a Msg-function.
- Code: Select all Expand view
- MsgAlert("Aaaa bbbb CCCC dddd eeee!","Take care")
Is it possible to put "CCCC" into bold or italic?
Thank you.
MsgAlert("Aaaa bbbb CCCC dddd eeee!","Take care")
#include "fivewin.ch"
#define CLR_VIOLET RGB( 170, 0, 255 )
#define CLR_PINK RGB( 244, 114, 208 )
#define CLR_CRIMSON RGB( 162, 0, 37 )
#define CLR_AMBER RGB( 240, 163, 10 )
#define CLR_OLIVE RGB( 109, 135, 100 )
#define CLR_STEEL RGB( 100, 118, 135 )
#define CLR_MAUVE RGB( 118, 96, 138 )
#define CLR_TAUPE RGB( 135, 121, 78 )
#define CLR_BLAUMETRO RGB( 0, 174, 219 )
#define CLR_ROTMETRO RGB( 191, 30, 75 )
#define CLR_PURPLE RGB( 111, 66, 193 )
REQUEST DBFCDX
REQUEST DBFFPT
function main
MetroMsgInfo( "Programmabbruch", "WINDOWS: There is no default printer currently selected" + CRLF +;
"Go into your Windows Control Panel and choose the Printer settings." + CRLF + CRLF +;
"Right-click the printer that you want to use, and then click Set as Default Printer."+ CRLF+;
"A check mark on the printer icon indicates that the printer is now the default printer." + CRLF + CRLF +;
"If the customer requires help with this they should refer to their IT administrator." )
return
INIT PROCEDURE PrgInit
SET CENTURY ON
SET EPOCH TO YEAR(DATE())-98
SET DELETED ON
SET EXCLUSIVE OFF
REQUEST HB_Lang_DE
HB_LangSelect("DE")
SET DATE TO GERMAN
rddsetdefault( "DBFCDX" )
EXTERN DESCEND
RETURN
//----------------------------------------------------------------------------//
FUNCTION MetroMsgInfo( cTitel, cAnzeige1 )
local lVar := .f.
local oDlg, oGet, oBTNNaviWeiter, oBTNNaviInfo, obtnAbbruch, oCbx
local cPassword := Space( 10 )
local nWidth := GetSysMetrics( 0 )
local nHeight := GetSysMetrics( 1 )
local nLine := 0
local nRowSpace := 20
local nRowOffset := 20
local cInfo := ( procname(1) + " " + str( procline(1) ) )
local oFntMetroNormal2, oFntMetroMedium2,oFntMetroFLATBTN
local nRibbonTopClr := rgb(227, 162, 26)
*----------------------------------------------------------
DEFAULT cTitel := "Infobox"
*----------------------------------------------------------
DEFINE FONT oFntMetroNormal2 NAME "TAHOMA" SIZE 0,-22
DEFINE FONT oFntMetroMedium2 NAME "TAHOMA" SIZE 0,-32
DEFINE FONT oFntMetroFLATBTN NAME "TAHOMA" SIZE 0,-18
oFntMetroSay := TFont():New( "Calibri", 0, -13, .F.,.F.,0,0,,.F.,.F.,.F.,0,3,2,1,,34 )
//cAnzeige1 := ansiToOem(cAnzeige1)
nLine := 16
DEFINE DIALOG oDlg ;
TITLE "Auswahl" ;
FROM 0, 5 ;
TO nHeight*1/2, nWidth + 6 ;
PIXEL ;
STYLE nOr( DS_MODALFRAME, WS_POPUP ) ;
COLOR CLR_WHITE, nRibbonTopClr ;
FONT oFntMetroFLATBTN
oDlg:SetFont( oFntMetroNormal2 )
nLine := 0.5
@ nRowOffset * nLine , nWidth/5/2.05 ;
SAY cTitel ;
OF oDlg ;
PIXEL ;
FONT oFntMetroMedium2 ;
COLOR CLR_WHITE, nRibbonTopClr
nLine := 2
@ nRowOffset + nRowSpace * nLine,nWidth/5/2.05 ;
SAY cAnzeige1 ;
OF oDlg ;
PIXEL ;
FONT oFntMetroMedium2 ;
COLOR CLR_WHITE, nRibbonTopClr ;
SIZE 600, 600
*----------------------------------------------------------
@ ( nHeight*1/2 - 65 ) / 2.05,nWidth/5/2.05 ;
BTNBMP oBTNNaviWeiter PROMPT "OK";
SIZE ( 128 ) /2.05, ( 64 ) /2.05 ;
PIXEL OF oDlg FLAT COLOR CLR_WHITE, CLR_ROTMETRO ;
ACTION ( lVar := .T., oDlg:End() ) ;
DEFAULT
@ 0,0 ;
FLATBTN oBTNNaviInfo ;
PROMPT "+" ;
FONT oFntMetroSay ;
SIZE ( 32) /2.05 , ( 32) /2.05 ;
OF oDlg ;
ACTION ( msginfo( cInfo ) ) ;
COLOR nRibbonTopClr, RGB( 210, 210, 210 )
oBTNNaviInfo:cTooltip := {"Info"}
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL
//----------------------------------------------------------------------------//
If GetPrintDefault() = 0
//? "no default printer"
MetroMsgInfo( "Programmabbruch", "WINDOWS: There is no default printer currently selected" + CRLF +;
"Go into your Windows Control Panel and choose the Printer settings." + CRLF + CRLF +;
"Right-click the printer that you want to use, and then click Set as Default Printer."+ CRLF+;
"A check mark on the printer icon indicates that the printer is now the default printer." + CRLF + CRLF +;
"If the customer requires help with this they should refer to their IT administrator." )
else
//
? "Default printer " + ud_prngetname()
endif
//----------------------------------------------------------------------------//
function ud_PrnGetName()
local cret, oprn
PRINTER oPrn
cRet := oPrn:getmodel()
endprint
return cret
//----------------------------------------------------------------------------//
// FWH\SAMPLES\OTTOMSG2.PRG
#Include "Fivewin.ch"
#define CLR_ROTMETRO RGB( 191, 30, 75 )
FUNCTION Main()
DefaultPrinter()
RETURN NIL
FUNCTION DefaultPrinter() // MODIFIQUEI A PRINTER.PRG E FUNCIONA...
LOCAL SGETDEFAULTPRINTER
LOCAL nPrn, nRet
/*
GetPrintDC( GetActiveWindow() )
// Coloca a impressora selecionada como Default do Windows
SetDefaultPrinter( PRNGETNAME() )
*/
nRet := PrinterSetUp()
nPrn := PrnGetName()
IF( nRet # 0 )
SetDefaultPrinter( PRNGETNAME() )
MetroMsgInfo( "Programmabbruch", "WINDOWS: There is no default printer currently selected" + CRLF +;
"Go into your Windows Control Panel and choose the Printer settings." + CRLF + CRLF +;
"Right-click the printer that you want to use, and then click Set as Default Printer."+ CRLF+;
"A check mark on the printer icon indicates that the printer is now the default printer." + CRLF + CRLF +;
"If the customer requires help with this they should refer to their IT administrator." )
sGetDefaultPrinter := GetDefaultPrinter()
// ? PrnStatus( sGetDefaultPrinter )
IF PrnStatus( sGetDefaultPrinter ) = 4096
// Verifica se SPOOLER esta desligado e tenta liga-lo
MsgRun( sGetDefaultPrinter +": "+isprint( GetDefaultPrinter() ) + ;
" ou Spooler Desligado.", "Status da Impressora", ;
{|| WinExec( "NET START SPOOLER", 7 ) } )
ENDIF
//? GetPrinter()
ELSE
? "Default Printer Is: " + ud_prngetname()
RETURN( .F. )
ENDIF
RETURN NIL
FUNCTION ud_PrnGetName()
LOCAL cRet, oPrn
PRINTER oPrn
cRet := oPrn:GetModel()
ENDPRINT
RETURN( cret )
FUNCTION MetroMsgInfo( cTitel, cAnzeige1 )
LOCAL oFntMetroSay
LOCAL lVar := .F.
LOCAL oDlg, oGet, oBTNNaviWeiter, oBTNNaviInfo, obtnAbbruch, oCbx
LOCAL cPassword := Space( 10 )
LOCAL nWidth := GetSysMetrics( 0 )
LOCAL nHeight := GetSysMetrics( 1 )
LOCAL nLine := 0
LOCAL nRowSpace := 20
LOCAL nRowOffset := 20
LOCAL cInfo := ( ProcName( 1 ) + " " + Str( ProcLine( 1 ) ) )
LOCAL oFntMetroNormal2, oFntMetroMedium2, oFntMetroFLATBTN
LOCAL nRibbonTopClr := rgb( 227, 162, 26 )
DEFAULT cTitel := "Infobox"
DEFINE FONT oFntMetroNormal2 NAME "TAHOMA" SIZE 0, - 22
DEFINE FONT oFntMetroMedium2 NAME "TAHOMA" SIZE 0, - 32
DEFINE FONT oFntMetroFLATBTN NAME "TAHOMA" SIZE 0, - 18
DEFINE FONT oFntMetroSay NAME 'Calibri' SIZE 0, -12 BOLD
// cAnzeige1 := ansiToOem(cAnzeige1)
nLine := 16
DEFINE DIALOG oDlg ;
TITLE "Auswahl" ;
FROM 0, 5 ;
TO nHeight * 1 / 2, nWidth + 6 ;
PIXEL ;
STYLE nOr( DS_MODALFRAME, WS_POPUP ) ;
COLOR CLR_WHITE, nRibbonTopClr ;
FONT oFntMetroFLATBTN
oDlg:SetFont( oFntMetroNormal2 )
nLine := 0.5
@ nRowOffset * nLine, nWidth / 5 / 2.05 ;
SAY cTitel ;
OF oDlg ;
PIXEL ;
FONT oFntMetroMedium2 ;
COLOR CLR_WHITE, nRibbonTopClr
nLine := 2
@ nRowOffset + nRowSpace * nLine, nWidth / 5 / 2.05 ;
SAY cAnzeige1 ;
OF oDlg ;
PIXEL ;
FONT oFntMetroMedium2 ;
COLOR CLR_WHITE, nRibbonTopClr ;
SIZE 600, 600
@ ( nHeight * 1 / 2 - 65 ) / 2.05, nWidth / 5 / 2.05 ;
BTNBMP oBTNNaviWeiter PROMPT "OK";
SIZE ( 128 ) / 2.05, ( 64 ) / 2.05 ;
PIXEL OF oDlg FLAT COLOR CLR_WHITE, CLR_ROTMETRO ;
ACTION ( lVar := .T., oDlg:End() )
@ 0, 0 ;
FLATBTN oBTNNaviInfo ;
PROMPT "+" ;
FONT oFntMetroSay ;
SIZE ( 32 ) / 2.05, ( 32 ) / 2.05 ;
OF oDlg ;
ACTION ( msginfo( cInfo ) ) ;
COLOR nRibbonTopClr, RGB( 210, 210, 210 )
oBTNNaviInfo:cTooltip := { "Info" }
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL
// FIN / END
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 76 guests