Bitmaps in buttonbar got shifted up

Bitmaps in buttonbar got shifted up

Postby hua » Tue Sep 27, 2011 2: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,

Image

to this,

Image

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

Snippet of buttonbar creation
Code: Select all  Expand view

     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
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: Bitmaps in buttonbar got shifted up

Postby Antonio Linares » Tue Sep 27, 2011 5:27 am

Hua,

Please add this function to your main PRG:

Code: Select all  Expand view
function IsAppThemed()

return .F.
regards, saludos

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

Re: Bitmaps in buttonbar got shifted up

Postby Antonio Linares » Tue Sep 27, 2011 5:47 am

Hua,

This is the right fix to apply:

Image
regards, saludos

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

Re: Bitmaps in buttonbar got shifted up

Postby hua » Tue Sep 27, 2011 6: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,
Image


With FWH11.8 31st Aug
Image

* edited *
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: Bitmaps in buttonbar got shifted up

Postby Antonio Linares » Tue Sep 27, 2011 8:24 am

Hua,

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

Image
regards, saludos

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

Re: Bitmaps in buttonbar got shifted up

Postby hua » Wed Sep 28, 2011 1:47 am

Hi Antonio, with the latest fwbmp.c compiled and updated to fivehgc.lib, I got this error message
Code: Select all  Expand view
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
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: Bitmaps in buttonbar got shifted up

Postby hua » Wed Sep 28, 2011 2:04 am

Resolved by adding to fwbmp.c
Code: Select all  Expand view

#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
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: Bitmaps in buttonbar got shifted up

Postby Antonio Linares » Wed Sep 28, 2011 7: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42085
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Bitmaps in buttonbar got shifted up

Postby hua » Wed Sep 28, 2011 7: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
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: Bitmaps in buttonbar got shifted up

Postby hua » Wed Sep 28, 2011 8: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: Select all  Expand view

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: Select all  Expand view

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
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: Bitmaps in buttonbar got shifted up

Postby Antonio Linares » Wed Sep 28, 2011 8: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42085
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Bitmaps in buttonbar got shifted up

Postby hua » Wed Sep 28, 2011 11:22 am

Here you go
Code: Select all  Expand view

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
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 75 guests