How to draw gray box in dialog *Fixed*

How to draw gray box in dialog *Fixed*

Postby dutch » Fri Feb 26, 2021 2:34 am

Dear All,

How to draw gray box in Dialog as picture?
Image

Thank you in advance,
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

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

Postby Antonio Linares » Fri Feb 26, 2021 12:50 pm

Dear Dutch,

How did you solved it ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41439
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby FranciscoA » Fri Feb 26, 2021 5:04 pm

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
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2114
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

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

Postby dutch » Sat Feb 27, 2021 12:21 am

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  Expand view
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
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

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

Postby nageswaragunupudi » Sat Feb 27, 2021 8:13 am

You can have all messagebox function like MsgInfo(), MsgYesNo(), MsgStop(), etc in your own language like this:
Code: Select all  Expand view
#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  Expand view

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10316
Joined: Sun Nov 19, 2006 5:22 am
Location: India

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

Postby dutch » Sat Feb 27, 2021 11:18 am

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,
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

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

Postby nageswaragunupudi » Sat Feb 27, 2021 11:23 am

Code: Select all  Expand view

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
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10316
Joined: Sun Nov 19, 2006 5:22 am
Location: India

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

Postby dutch » Sun Feb 28, 2021 1:25 am

Dear Master,

Thank you so much.
nageswaragunupudi wrote:
Code: Select all  Expand view

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
 
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 18 guests