FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Bitmaps in buttonbar got shifted up
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Bitmaps in buttonbar got shifted up
Posted: Tue Sep 27, 2011 02:38 AM
Antonio, linking with the latest lib emailed to me causes the images in my buttonbar seems to be shifted up. It became from this,



to this,



WindowsXP.Manifest was linked-in and BUTTONBAR was using neither 2007 nor 2010 clause.

Snippet of buttonbar creation
Code (fw): Select all Collapse
     define buttonbar oBar of oWnd size 30,33 3dlook
     oBar:setBrush(oBrush1)

     DEFINE BUTTON oBtnB_Xtract RESOURCE "EXTRACT" OF oBar ;
        TOOLTIP "Xtract"                                  ;
        ACTION (                                          ;
                 lExtract := TRUE,                         ;
                 IF( cStat == STAT_DISP,                  ;
                     (                                    ;
                       EVAL( oBtnB_Add:bAction )          ;
                     ),                                   ;
                   ),                                     ;
                 I_Xtract()                               ;
               )


Please tell me how to fix this.

TIA
p.s. I could've sworn I've read something similar in the past but couldn't find the thread
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bitmaps in buttonbar got shifted up
Posted: Tue Sep 27, 2011 05:27 AM
Hua,

Please add this function to your main PRG:

Code (fw): Select all Collapse
function IsAppThemed()

return .F.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bitmaps in buttonbar got shifted up
Posted: Tue Sep 27, 2011 05:47 AM
Hua,

This is the right fix to apply:

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: Bitmaps in buttonbar got shifted up
Posted: Tue Sep 27, 2011 06:44 AM
Thanks Antonio. Changed btnbmp.prg and the bitmaps position is now ok but the buttons seems kinda "flat", as though they're in pressed state

Now,



With FWH11.8 31st Aug


* edited *
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bitmaps in buttonbar got shifted up
Posted: Tue Sep 27, 2011 08:24 AM
Hua,

I missed that painting effect, please revert the previous change and apply this one, thanks! :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: Bitmaps in buttonbar got shifted up
Posted: Wed Sep 28, 2011 01:47 AM
Hi Antonio, with the latest fwbmp.c compiled and updated to fivehgc.lib, I got this error message
Code (fw): Select all Collapse
Error: Unresolved external '_HB_ISCHAR' referenced from J:\HARBOUR\FWH\LIB\FIVEHC.LIB|fwbmp
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: Bitmaps in buttonbar got shifted up
Posted: Wed Sep 28, 2011 02:04 AM
Resolved by adding to fwbmp.c
Code (fw): Select all Collapse
#ifndef HB_ISCHAR
   #define HB_ISCHAR( n )  ( hb_param( n, HB_IT_STRING ) != NULL )
#endif


This issue is now resolved :-)
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bitmaps in buttonbar got shifted up
Posted: Wed Sep 28, 2011 07:07 AM

Hua,

HB_ISCHAR() is defined in hbapi.h, so you just need to add #include <hbapi.h> :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: Bitmaps in buttonbar got shifted up
Posted: Wed Sep 28, 2011 07:14 AM

I see, thanks for the clarification. I guess the error arise as I'm still using a very old version of xHarbour (rev 6406) due to some bugs making my hbapi.h outdated.

FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: Bitmaps in buttonbar got shifted up
Posted: Wed Sep 28, 2011 08:30 AM
Antonio,
FYI, I tried compiling fwbmp.c using MinGW + Harbour 17053. To get the obj file I compile using my -.bat which contain this
Code (fw): Select all Collapse
hbmk2 %1 %2 xhb.hbc j:\harbour\fwh\fwh.hbc


Amidst the warnings there are 2 errors as below (I'm using hbmk2's -clipper switch so it'll compile up to obj only and produces no exe)
Code (fw): Select all Collapse
J:\harbour\fwh\samples>- fwbmp.c -clipper
hbmk2 fwbmp.c -clipper xhb.hbc j:\harbour\fwh\fwh.hbc
fwbmp.c: In function 'HB_FUN_PALBMPLOAD':
fwbmp.c:344:11: error: too many arguments to function 'hb_stornl'
C:/downloads/Harbour/trunk/harbour/include/hbapi.h:754:25: note: declared here
fwbmp.c:345:11: error: too many arguments to function 'hb_stornl'
C:/downloads/Harbour/trunk/harbour/include/hbapi.h:754:25: note: declared here
fwbmp.c: In function 'hPalBitmapDraw':
fwbmp.c:387:15: warning: unused variable 'cZeroZeroColor' [-Wunused-variable]
fwbmp.c:385:21: warning: unused variable 'nCol' [-Wunused-variable]
fwbmp.c:385:15: warning: unused variable 'nRow' [-Wunused-variable]
fwbmp.c: In function 'HB_FUN_PALBTNPAINT':
fwbmp.c:654:10: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
fwbmp.c:706:16: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
fwbmp.c:754:16: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
fwbmp.c:583:16: warning: unused variable 'tm' [-Wunused-variable]
hbmk2: Error: Running C/C++ compiler. 1
gcc.exe -c -O3 -march=i586 -mtune=pentiumpro -fomit-frame-pointer  -W -Wall -ofwbmp.o -IC:/downloads/Harbour/trunk/harbour/include -IC:/download
s/Harbour/trunk/harbour/contrib/xhb -IC:/downloads/Harbour/trunk/harbour/contrib/hbct -IC:/downloads/Harbour/trunk/harbour/contrib/hbtip -IC:/do
wnloads/Harbour/trunk/harbour/contrib/hbwin -IC:/downloads/Harbour/trunk/harbour/contrib/hbfship -IC:/downloads/Harbour/trunk/harbour/contrib/hb
xpp -Ij:/harbour/fwh/include fwbmp.c
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bitmaps in buttonbar got shifted up
Posted: Wed Sep 28, 2011 08:45 AM

Hua,

Please check how hb_stornl() is defined in your used hbapi.h and copy it here, thanks :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: Bitmaps in buttonbar got shifted up
Posted: Wed Sep 28, 2011 11:22 AM
Here you go
Code (fw): Select all Collapse
extern HB_EXPORT int    hb_stornl( long lValue, int iParam ); /* stores a long on a variable by reference */
#ifndef HB_LONG_LONG_OFF
extern HB_EXPORT int    hb_stornll( HB_LONGLONG llValue, int iParam ); /* stores a long long on a variable by reference */
#endif
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour

Continue the discussion