ButtonBmp problem with FWH2402

ButtonBmp problem with FWH2402

Postby richard-service » Wed Mar 06, 2024 6:27 pm

Hi
I use FWH2212 working fine.
When use FWH2402 appear Chinese word does not display syntax command REDEFINE

Image
Code: Select all  Expand view

             REDEFINE BUTTONBMP oBtn[1] ID 301 OF ::oDlg  ;
                      PROMPT "確 定"                      ;
                      TEXTRIGHT                           ;
                      BITMAP "BTN_Confirm24"              ;
                      ACTION ( lOK := .T. , ::oDlg:End() )

             REDEFINE BUTTONBMP oBtn[2] ID 302 OF ::oDlg  ;
                      PROMPT "取 消"                      ;
                      CANCEL                              ;
                      TEXTRIGHT                           ;
                      BITMAP "BTN_Cancel24"               ;
                      ACTION ( lOK := .F. , ::oDlg:End() )

             REDEFINE BUTTONBMP oBtn[3] ID 303 OF ::oDlg  ;
                      PROMPT "設 定"                      ;
                      TEXTRIGHT                           ;
                      BITMAP "BTN_SetPrinter24"           ;
                      ACTION PrinterSetup()
 


This working fine below:
Image
Code: Select all  Expand view

      @ 103, 0  BUTTONBMP ::oBut[1] OF ::oDlg         ;
                SIZE 50, 16 PIXEL                     ;
                PROMPT "確定"                         ;
                RESOURCE "BTN_Confirm24"              ;
                TOOLTIP "選取日期"                    ;
                ACTION (::lOk := .T., ::oDlg:End() )  ;
                CANCEL                                ;
                TEXTRIGHT                

      @ 103, 50 BUTTONBMP ::oBut[2] OF ::oDlg         ;
                SIZE 50, 16 PIXEL                     ;
                PROMPT "取消"                         ;
                RESOURCE "BTN_Cancel24"               ;
                TOOLTIP "取消選取日期"                ;
                ACTION (::lOk := .F., ::oDlg:End() )  ;
                CANCEL                                ;
                TEXTRIGHT                
 


I use .dll file not rc or res.
Image
Last edited by richard-service on Thu Mar 07, 2024 1:56 am, edited 5 times in total.
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: ButtonBmp problem with FWH2402

Postby leandro » Wed Mar 06, 2024 8:51 pm

Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Embarcadero C++ 7.60 for Win32 ] [ FiveWin 23.07 ] [ xHarbour 1.3.0 Intl. (SimpLex) (Build 20230914) ]
User avatar
leandro
 
Posts: 1676
Joined: Wed Oct 26, 2005 2:49 pm
Location: Colombia

Re: ButtonBmp problem with FWH2402

Postby richard-service » Thu Mar 07, 2024 1:46 am



Yes, And very unstable.

This PROMPT empty space that only not show Chinese word
Code: Select all  Expand view

REDEFINE BUTTONBMP ....
PROMPT "取 消"
 


This PROMPT not empty space that crash my app
Code: Select all  Expand view

REDEFINE BUTTONBMP ....
PROMPT "取消"
 
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: ButtonBmp problem with FWH2402

Postby nageswaragunupudi » Thu Mar 07, 2024 5:07 am

Trying to reproduce the problem here
First sample from Source Code (not Resource)

Code: Select all  Expand view
#include "fivewin.ch"

function Main()

   local oDlg, oBtn, oFont

   FW_SetUnicode( .T. )
   SetBalloon( .t. )

   DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-24
   DEFINE DIALOG oDlg SIZE 300,300 PIXEL TRUEPIXEL TITLE FWVERSION ;
      FONT oFont


     @  50,50  BUTTONBMP oBtn OF oDlg         ;
                SIZE 150, 50 PIXEL                     ;
                PROMPT "確定"                         ;
                TOOLTIP "選取日期"                    ;
                ACTION ( oDlg:End() )  ;
                CANCEL                                ;
                TEXTRIGHT                

      @ 150,50 BUTTONBMP oBtn OF oDlg         ;
                SIZE 150, 50 PIXEL                     ;
                PROMPT "取消"                         ;
                TOOLTIP "取消選取日期"                ;
                ACTION ( oDlg:End() )  ;
                CANCEL                                ;
                TEXTRIGHT                

   ACTIVATE DIALOG oDlg CENTERED

return nil
 


Image

We do not see any problem here
Regards

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

Re: ButtonBmp problem with FWH2402

Postby nageswaragunupudi » Thu Mar 07, 2024 5:26 am

We see a problem here
This is the problem faced by Mr. Leandro also.

RC file used by us for testing:
Code: Select all  Expand view
#include "..\include\winapi.ch"

#ifndef __64__
   1 24 ".\winxp\WindowsXP.Manifest"
#endif

#ifdef __64__
   1 24 "WinXP/WindowsXP.Manifest64"
#endif


test DIALOG 117, 94, 194, 119
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "XP theme aware Buttons Bitmap"
FONT 8, "MS Sans Serif"
{
 PUSHBUTTON "", 10, 13, 18, 20, 17
 DEFPUSHBUTTON "&OK", IDOK, 69, 95, 50, 16
 PUSHBUTTON "", 20, 13, 43, 120, 30
}
 


Test program in Chinese:
Code: Select all  Expand view
#include "FiveWin.ch"

//----------------------------------------------------------------------------//

function Main()

   local oDlg, oFont

   FW_SetUnicode( .T. )

   DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-20
   DEFINE DIALOG oDlg RESOURCE "Test" TITLE FWVERSION FONT oFont

   REDEFINE BUTTONBMP ID 10 OF oDlg ;
      BITMAP "..\bitmaps\16x16\garrow.bmp"

   REDEFINE BUTTONBMP ID 20 OF oDlg ;
      BITMAP "..\bitmaps\32x32\paste.bmp" ;
      PROMPT "取 消" TEXTRIGHT

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil
 


Result:

Image

Please give us sometime and we will get back to you with fix.
Regards

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

Re: ButtonBmp problem with FWH2402

Postby nageswaragunupudi » Thu Mar 07, 2024 5:58 am

What is observed till now is that the misbehavior is when FW_SetUnicode( .T. )
Request Mr. Leandro to set FW_SetUnicode( .F. ) and retry
We will work on fixing this problem
Regards

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

Re: ButtonBmp problem with FWH2402

Postby nageswaragunupudi » Thu Mar 07, 2024 6:20 am

This is working
Code: Select all  Expand view
#include "FiveWin.ch"

//----------------------------------------------------------------------------//

function Main()

   local oDlg, oFont, oBmp

   FW_SetUnicode( .f. )

   DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-20
   DEFINE DIALOG oDlg RESOURCE "Test" TITLE FWVERSION FONT oFont

   REDEFINE BUTTONBMP ID 10 OF oDlg ;
      BITMAP "..\bitmaps\16x16\garrow.bmp"

   REDEFINE BUTTONBMP oBmp ID 20 OF oDlg ;
      BITMAP "..\bitmaps\32x32\paste.bmp" ;
      PROMPT "取 消" TEXTRIGHT
   oBmp:lUnicode := .t.

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil


RC file
Code: Select all  Expand view
#include "..\include\winapi.ch"

#ifndef __64__
   1 24 ".\winxp\WindowsXP.Manifest"
#endif

#ifdef __64__
   1 24 "WinXP/WindowsXP.Manifest64"
#endif


test DIALOG 117, 94, 494, 119
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "XP theme aware Buttons Bitmap"
FONT 8, "MS Sans Serif"
{
 PUSHBUTTON "", 10, 13, 18, 20, 17
 DEFPUSHBUTTON "&OK", IDOK, 69, 95, 50, 16
 PUSHBUTTON "", 20, 13, 43, 420, 30
}
 

Image

We will fix the issue and get back to you soon
Regards

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

Re: ButtonBmp problem with FWH2402

Postby richard-service » Thu Mar 07, 2024 6:58 am

nageswaragunupudi wrote:Trying to reproduce the problem here
First sample from Source Code (not Resource)

Code: Select all  Expand view
#include "fivewin.ch"

function Main()

   local oDlg, oBtn, oFont

   FW_SetUnicode( .T. )
   SetBalloon( .t. )

   DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-24
   DEFINE DIALOG oDlg SIZE 300,300 PIXEL TRUEPIXEL TITLE FWVERSION ;
      FONT oFont


     @  50,50  BUTTONBMP oBtn OF oDlg         ;
                SIZE 150, 50 PIXEL                     ;
                PROMPT "確定"                         ;
                TOOLTIP "選取日期"                    ;
                ACTION ( oDlg:End() )  ;
                CANCEL                                ;
                TEXTRIGHT                

      @ 150,50 BUTTONBMP oBtn OF oDlg         ;
                SIZE 150, 50 PIXEL                     ;
                PROMPT "取消"                         ;
                TOOLTIP "取消選取日期"                ;
                ACTION ( oDlg:End() )  ;
                CANCEL                                ;
                TEXTRIGHT                

   ACTIVATE DIALOG oDlg CENTERED

return nil
 


Image

We do not see any problem here


Yes, I know. I said no problem.
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: ButtonBmp problem with FWH2402

Postby richard-service » Thu Mar 07, 2024 7:15 am

nageswaragunupudi wrote:This is working
Code: Select all  Expand view
#include "FiveWin.ch"

//----------------------------------------------------------------------------//

function Main()

   local oDlg, oFont, oBmp

   FW_SetUnicode( .f. )

   DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-20
   DEFINE DIALOG oDlg RESOURCE "Test" TITLE FWVERSION FONT oFont

   REDEFINE BUTTONBMP ID 10 OF oDlg ;
      BITMAP "..\bitmaps\16x16\garrow.bmp"

   REDEFINE BUTTONBMP oBmp ID 20 OF oDlg ;
      BITMAP "..\bitmaps\32x32\paste.bmp" ;
      PROMPT "取 消" TEXTRIGHT
   oBmp:lUnicode := .t.

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil


RC file
Code: Select all  Expand view
#include "..\include\winapi.ch"

#ifndef __64__
   1 24 ".\winxp\WindowsXP.Manifest"
#endif

#ifdef __64__
   1 24 "WinXP/WindowsXP.Manifest64"
#endif


test DIALOG 117, 94, 494, 119
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "XP theme aware Buttons Bitmap"
FONT 8, "MS Sans Serif"
{
 PUSHBUTTON "", 10, 13, 18, 20, 17
 DEFPUSHBUTTON "&OK", IDOK, 69, 95, 50, 16
 PUSHBUTTON "", 20, 13, 43, 420, 30
}
 

Image

We will fix the issue and get back to you soon


Dear Mr.Rao

I just to test my code below:
Code: Select all  Expand view

FW_SetUnicode( .T. )
SET RESOURCES TO 'WinCrane365.dll'
......
   REDEFINE BUTTONBMP oBmp ID 20 OF oDlg ;
      BITMAP "..\bitmaps\32x32\paste.bmp" ;
      PROMPT "取 消" TEXTRIGHT
   
     oBmp:lUnicode := .t.
 


Add oBmp:lUnicode := .t. working find.
There's no way I could spend too much time adding this.
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: ButtonBmp problem with FWH2402

Postby Antonio Linares » Thu Mar 07, 2024 7:31 am

Dear Richard,

We are working to solve it asap

We apologize for these inconveniencies
regards, saludos

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

Re: ButtonBmp problem with FWH2402

Postby nageswaragunupudi » Thu Mar 07, 2024 8:11 am

Antonio Linares wrote:Dear Richard,

We are working to solve it asap

We apologize for these inconveniencies


We do not expect you to do that.
We will provide an easy fix for you.
Regards

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

Re: ButtonBmp problem with FWH2402

Postby nageswaragunupudi » Thu Mar 07, 2024 8:18 am

This problem appears only when both AppIsThemed() and FW_SetUnicode() is set to .T.
In all other cases it is working fine.

Now we request you to apply the following fix and let us know if everything is working fine.

Please open \fwh\source\classes\buttonb.prg

Please locate this method
Code: Select all  Expand view
METHOD ReDefine( nId, bAction, oWnd, nHelpId, cMsg,;
                 lUpdate, bWhen, bValid, cPrompt, lCancel, cBitmap, cPosText, cToolTip, lGDIP ) CLASS TButtonBmp

   DEFAULT cPrompt := "", cPosText := ::cPosDefault, lGDIP := .F.

   ::LoadBitmap( cBitmap )
   ::cPosText  = Upper( cPosText )
   ::cToolTip  = cToolTip
   ::lGDIP     = lGDIP

return ::Super:Redefine( nId, bAction, oWnd, nHelpId, cMsg, lUpdate, bWhen,;
                       bValid, cPrompt, lCancel )
 


Insert this line
Code: Select all  Expand view
::lUnicode  = oWnd:lUnicode


as indicted below:
Code: Select all  Expand view
METHOD ReDefine( nId, bAction, oWnd, nHelpId, cMsg,;
                 lUpdate, bWhen, bValid, cPrompt, lCancel, cBitmap, cPosText, cToolTip, lGDIP ) CLASS TButtonBmp

   DEFAULT cPrompt := "", cPosText := ::cPosDefault, lGDIP := .F.

   ::LoadBitmap( cBitmap )
   ::cPosText  = Upper( cPosText )
   ::cToolTip  = cToolTip
   ::lGDIP     = lGDIP
   ::lUnicode  = oWnd:lUnicode  // <-- INSERT THIS LINE HERE

return ::Super:Redefine( nId, bAction, oWnd, nHelpId, cMsg, lUpdate, bWhen,;
                       bValid, cPrompt, lCancel )
 


Please use this modified buttonb.prg and provide us your feedback.
Thank you both
Regards

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

Re: ButtonBmp problem with FWH2402

Postby richard-service » Thu Mar 07, 2024 8:36 am

nageswaragunupudi wrote:This problem appears only when both AppIsThemed() and FW_SetUnicode() is set to .T.
In all other cases it is working fine.

Now we request you to apply the following fix and let us know if everything is working fine.

Please open \fwh\source\classes\buttonb.prg

Please locate this method
Code: Select all  Expand view
METHOD ReDefine( nId, bAction, oWnd, nHelpId, cMsg,;
                 lUpdate, bWhen, bValid, cPrompt, lCancel, cBitmap, cPosText, cToolTip, lGDIP ) CLASS TButtonBmp

   DEFAULT cPrompt := "", cPosText := ::cPosDefault, lGDIP := .F.

   ::LoadBitmap( cBitmap )
   ::cPosText  = Upper( cPosText )
   ::cToolTip  = cToolTip
   ::lGDIP     = lGDIP

return ::Super:Redefine( nId, bAction, oWnd, nHelpId, cMsg, lUpdate, bWhen,;
                       bValid, cPrompt, lCancel )
 


Insert this line
Code: Select all  Expand view
::lUnicode  = oWnd:lUnicode


as indicted below:
Code: Select all  Expand view
METHOD ReDefine( nId, bAction, oWnd, nHelpId, cMsg,;
                 lUpdate, bWhen, bValid, cPrompt, lCancel, cBitmap, cPosText, cToolTip, lGDIP ) CLASS TButtonBmp

   DEFAULT cPrompt := "", cPosText := ::cPosDefault, lGDIP := .F.

   ::LoadBitmap( cBitmap )
   ::cPosText  = Upper( cPosText )
   ::cToolTip  = cToolTip
   ::lGDIP     = lGDIP
   ::lUnicode  = oWnd:lUnicode  // <-- INSERT THIS LINE HERE

return ::Super:Redefine( nId, bAction, oWnd, nHelpId, cMsg, lUpdate, bWhen,;
                       bValid, cPrompt, lCancel )
 


Please use this modified buttonb.prg and provide us your feedback.
Thank you both


Dear Mr.Rao

Now it's working.
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: ButtonBmp problem with FWH2402

Postby nageswaragunupudi » Thu Mar 07, 2024 9:09 am

Now it's working.


Glad to know.
Mr. Leandro
Can you too please test and provide your feedback?
Regards

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

Re: ButtonBmp problem with FWH2402

Postby leandro » Thu Mar 07, 2024 2:02 pm

Mr. Rao, Antonio gracias por responder

Antonio te molesto si me envías las libs con el ajuste que menciona Mr. Rao, ya que al agregar el buttonb.prg modificado al proyecto de fivedit, sale el siguiente error:

Code: Select all  Expand view

Turbo Incremental Link 6.97 Copyright (c) 1997-2022 Embarcadero Technologies, Inc.
Fatal: Unable to open file 'BUTTONB.OBJ'
Link Error
 


no hemos podido comprobar si es la solución :oops: , de antemano gracias
Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Embarcadero C++ 7.60 for Win32 ] [ FiveWin 23.07 ] [ xHarbour 1.3.0 Intl. (SimpLex) (Build 20230914) ]
User avatar
leandro
 
Posts: 1676
Joined: Wed Oct 26, 2005 2:49 pm
Location: Colombia

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi and 48 guests