Page 1 of 1

How to draw gray box in dialog *Fixed*

Posted: Fri Feb 26, 2021 2:34 am
by dutch
Dear All,

How to draw gray box in Dialog as picture?
Image

Thank you in advance,

Re: How to draw gray box in dialog *Fixed*

Posted: Fri Feb 26, 2021 12:50 pm
by Antonio Linares
Dear Dutch,

How did you solved it ?

Re: How to draw gray box in dialog *Fixed*

Posted: Fri Feb 26, 2021 5:04 pm
by FranciscoA
dutch wrote:Dear All,

How to draw gray box in Dialog as picture?
Image

Thank you in advance,
http://fivetechsupport.com/forums/viewt ... 4c#p228461

Re: How to draw gray box in dialog *Fixed*

Posted: Sat Feb 27, 2021 12:21 am
by dutch
Antonio Linares wrote:Dear Dutch,

How did you solved it ?
I need to define FONT for the message.

@ 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.

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
Image

Re: How to draw gray box in dialog *Fixed*

Posted: Sat Feb 27, 2021 8:13 am
by nageswaragunupudi
You can have all messagebox function like MsgInfo(), MsgYesNo(), MsgStop(), etc in your own language like this:

Code: Select all

#include "fivewin.ch"

function Main()

   FW_SetUnicode( .t. )

   SetMsgLangID( 0x041e ) // Thai

   MsgYesNo( "คุณชอบนี่ไหม?" )

return nil
 
Image

This is a built-in feature of Windows and FWH makes it available to you through the function SetMsgLangID().
You can also enable your software to display all these alert messages in any language of your choice depending on the need

Code: Select all

nSaveLangID := SetMsgLangID( nNewLangID )
// show your messages and restore the original lang
SetMsgLangID( nSaveLangID )
 

Re: How to draw gray box in dialog *Fixed*

Posted: Sat Feb 27, 2021 11:18 am
by dutch
Dear Master Rao,

Thai language is not a problem. It can show correctly without problem.

I need to set the different image, button and font style. The standard is working properly but
1. font is too small.
2. font style is unable to change.
3. the image of info, alert, stop and question are not flat style that I like.

This is the reason, I need.

Thanks and regards,

Re: How to draw gray box in dialog *Fixed*

Posted: Sat Feb 27, 2021 11:23 am
by nageswaragunupudi

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
 

Re: How to draw gray box in dialog *Fixed*

Posted: Sun Feb 28, 2021 1:25 am
by dutch
Dear Master,

Thank you so much.
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