How to draw gray box in dialog *Fixed*
Posted: Fri Feb 26, 2021 2:34 am
www.FiveTechSoft.com
https://fivetechsoft.com/forums/
I need to define FONT for the message.Antonio Linares wrote:Dear Dutch,
How did you solved it ?
Code: Select all
Function MsgYesNo( cText, cTitle, lLeftAlign )
local oDlg, oSay, oSays, oBtn[3], oImg
local lChk, nRight, nBottom
Default cTitle := TE('เลือกตัวเลือก','Select Options'), lLeftAlign := .F.
lChk := .F.
nRight := iif(HB_UTF8LEN(cText)<60,300,iif(HB_UTF8LEN(cText)<100,350,400))
nBottom := iif(HB_UTF8LEN(cText)<100,160,180) // 180
DEFINE DIALOG oDlg FROM 0, 0 TO nBottom, nRight PIXEL TITLE cTitle ;
COLOR FONTTHEME, THEME2007 ;
FONT MEMVAR->oFont ;
TRUEPIXEL ;
oDlg:lHelpIcon := .F.
@ 10, 10 XIMAGE oImg RESOURCE "MSGYESNO" OF oDlg SIZE 32, 32 NOBORDER
if lLeftAlign
@ 50, 30 SAY oSay PROMPT rtrim(cText) OF oDlg SIZE nRight-60, 80 PIXEL COLOR nRGB( 40, 40, 40 )
else
@ 50, 30 SAY oSay PROMPT rtrim(cText) OF oDlg SIZE nRight-60, 80 CENTER PIXEL COLOR nRGB( 40, 40, 40 )
end
@ nBottom-50, 0 SAY oSays PROMPT space(1000) OF oDlg SIZE nRight+1, 50 PIXEL COLOR CLR_WHITE, nRGB( 245, 245, 245 )
oSays:lTransparent := .F.
@ nBottom-40,(nRight/2)-100 SBUTTON oBtn[1] PROMPT TE('ใช่','Yes') OF oDlg SIZE 80, 30 PIXEL ;
RESOURCE 'OK8' ;
COLOR bSColors NOBORDER ; // ROUNDRECT ;
TEXT ON_RIGHT ;
ACTION (lChk := .T., oDlg:End())
@ nBottom-40,(nRight/2)+20 SBUTTON oBtn[2] PROMPT TE('ไม่','No') OF oDlg SIZE 80, 30 PIXEL ;
RESOURCE 'NO8' ;
COLOR bSColors NOBORDER ; // ROUNDRECT ;
TEXT ON_RIGHT ;
ACTION (oDlg:End())
oBtn[2]:bLostFocus := {|| oBtn[1]:SetFocus() }
ACTIVATE DIALOG oDlg CENTER ON INIT (oBtn[1]:SetFocus())
return lChk
Code: Select all
#include "fivewin.ch"
function Main()
FW_SetUnicode( .t. )
SetMsgLangID( 0x041e ) // Thai
MsgYesNo( "คุณชอบนี่ไหม?" )
return nil
Code: Select all
nSaveLangID := SetMsgLangID( nNewLangID )
// show your messages and restore the original lang
SetMsgLangID( nSaveLangID )
Code: Select all
DEFINE DIALOG oDlg SIZE 400,500 PIXEL TRUEPIXEL
// Define all your controls here
oDlg:bPainted := <|hDC|
FillRectEx( hDC, { 350, 0, 500, 400 }, <yourcolor> )
return nil
>
ACTIVATE DIALOG oDlg CENTERED
nageswaragunupudi wrote:Code: Select all
DEFINE DIALOG oDlg SIZE 400,500 PIXEL TRUEPIXEL // Define all your controls here oDlg:bPainted := <|hDC| FillRectEx( hDC, { 350, 0, 500, 400 }, <yourcolor> ) return nil > ACTIVATE DIALOG oDlg CENTERED