FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour BtnBmp changed behavior?
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
BtnBmp changed behavior?
Posted: Thu Oct 14, 2010 04:47 PM
Hi.

On a BtnBmp I have what it seems to be like the word "SerDefine" written over the bmp-button. This must be do to a change on the btnbmp class for I did not have this problem before. Furthermore my btnbmps are no longer transparent. See image:



How do I get rid of "SerDefine" and make my btnbmp transparent again?


Reinaldo.
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: BtnBmp changed behavior?
Posted: Thu Oct 14, 2010 11:20 PM

Ok. I found the source of the "selfdefine" text that was painting on top of the btnbmp.

But so far I haven't figure out why the btnbmp isn't transparent. Look a the exit door above. Notice the gradient is not being applied to its background.

oh- and another thing is that the btnbmp is now "raised". With my previous fwh version it wasn't.

I'm especially concern about the btnbmp not being transparent.

Any ideas?

Reinaldo.

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: BtnBmp changed behavior?
Posted: Fri Oct 15, 2010 12:28 AM

Reinaldo,

I suspect this and the dialog flickering are both due to changes made to try to handle tranparency and themes. See this thread:

viewtopic.php?f=3t=19966

There are 18 possible combinations that need to be tested and resolved if needed.

Regards,
James

&

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: BtnBmp changed behavior?
Posted: Fri Oct 15, 2010 12:43 AM

James;

I think my emails are not reaching you. Can you write to me so that I can reply? reinaldo dot crespo

at gmail of course.

Reinaldo.

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: BtnBmp changed behavior?
Posted: Fri Oct 15, 2010 01:01 AM

Reinaldo,

I have the same email address I have always had (since the 80's)-- [jbott at compuserve dot com]. I can also be reached at [jbott at gointellitech dot com].

I did find one email from you that I missed and I have responded. Did you send others?

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: BtnBmp changed behavior?
Posted: Fri Oct 15, 2010 06:56 AM

Reinaldo,

Please post here the RC for that dialog, the source code that you use for it and the bitmaps, thanks :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: BtnBmp changed behavior?
Posted: Fri Oct 15, 2010 07:46 PM
Antonio;

Hi.

First this is the code:
Code (fw): Select all Collapse
    REDEFINE BTNBMP aoBtns[ 1 ] ID 301 OF oDlg RESOURCE "Save32" TOOLTIP "Save to Disk" NOBORDER ;
        ACTION (!empty( odbf:VarType ) .or. !NoBlankRecord( odbf, "Type" ) .or. !odbf:isadd) .and. ;
            ( iif( odbf:IsAdd, odbf:append(), ),        ;
            odbf:save(), odbf:IsAdd := .f., .t. ),  ;
            obrw:refresh(), odlg:end()

    REDEFINE BTNBMP aoBtns[ 2 ] ID 302 OF oDlg RESOURCE "Exit32" TOOLTIP "Exit" NOBORDER ACTION odlg:end()
    aeval( aoBtns, { |e| e:ltransparent := .t., e:oCursor := ocursor } )


Exit32.bmp is here:
http://ssfl.dynalias.com/temp_files/exit32.bmp

Save32.bmp is here:
http://ssfl.dynalias.com/temp_files/save32.bmp

This is a screenshot of the app built using an older fwh + bcc55 + xharb 0.99.6. Notice the bmps are transparent.


This is a screenshot of the app built using current fwh + bcc582 + xharb 1.2.1_6741. Look at the exit door.


Furthermore, when you place the cursor just over the btnbmp, on the newer version the button raises with a 3dlook. Not good especially when you have btnbmps that are not squared. TsButtons are working perfectly. The problem is only with btnbmps.


Thank you for your help.


Reinaldo.
Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
Re: BtnBmp changed behavior?
Posted: Fri Oct 15, 2010 10:46 PM

One of the things I had to do was change all of my buttons in the rc to Owner Draw or use the TBtnBmp add in control for Borland workshop.

Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: BtnBmp changed behavior?
Posted: Fri Oct 15, 2010 11:02 PM

Hey Gale;

Thank you.

I have a college buddy in Houston.

Is that the Dialog or the btnbmp control that I should change to owner draw?

I'm using Resource Builder to manage resources. Can't find an owner draw property.... ?

Reinaldo.

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: BtnBmp changed behavior?
Posted: Sat Oct 16, 2010 06:43 AM

Reinaldo,

Please post the RC section for that dialog box, thanks :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: BtnBmp changed behavior?
Posted: Sat Oct 16, 2010 05:30 PM
Hi.

The RC section for the dialog is:
Code (fw): Select all Collapse
REVENUECODES DIALOG 6, 15, 225, 150
STYLE DS_SETFONT |DS_MODALFRAME |WS_OVERLAPPED |WS_VISIBLE |WS_CAPTION 
CAPTION "Revenue Code Detail"
FONT 8, "MS Sans Serif"
LANGUAGE LANG_NEUTRAL, 0
BEGIN
  CONTROL "",502,"STATIC",SS_BLACKFRAME |WS_CHILD |WS_VISIBLE ,5,5,212,100
  CONTROL "",101,"EDIT",ES_NOHIDESEL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP ,64,15,36,12
  CONTROL "",102,"EDIT",ES_NOHIDESEL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP ,64,28,144,12
  CONTROL "",103,"EDIT",ES_NOHIDESEL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP ,64,41,63,12
  CONTROL "",104,"EDIT",ES_NOHIDESEL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP ,64,54,63,12
  CONTROL "",105,"EDIT",ES_NOHIDESEL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP ,64,67,63,12
  CONTROL "Rev-Code",65535,"STATIC",SS_RIGHT |WS_CHILD ,6,17,54,8
  CONTROL "Description",65535,"STATIC",SS_RIGHT |WS_CHILD ,6,31,54,8
  CONTROL "GL-Acc IN",65535,"STATIC",SS_RIGHT |WS_CHILD ,6,44,54,8
  CONTROL "GL-Acc OUT",65535,"STATIC",SS_RIGHT |WS_CHILD ,6,56,54,8
  CONTROL "Serv-Code",65535,"STATIC",SS_RIGHT |WS_CHILD ,6,68,54,8
  CONTROL "",301,"TBTNBMP",WS_CHILD |0xF0B,142,116,36,30
  CONTROL "",302,"TBTNBMP",WS_CHILD |0xF0B,182,116,36,30
  CONTROL "Edit5",106,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,64,80,63,14
  CONTROL "Cost Ratio",1,"STATIC",SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,20,83,39,8
END


Reinaldo.
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: BtnBmp changed behavior?
Posted: Sun Oct 17, 2010 08:24 AM

Reinaldo,

What is 0xF0B ?

CONTROL "",301,"TBTNBMP",WS_CHILD |0xF0B,142,116,36,30

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: BtnBmp changed behavior?
Posted: Sun Oct 17, 2010 03:08 PM

Antonio;

Hi.

I'm not sure. I'm managing these resources using Resource Builder. I'm thinking it was added by it. I removed it and recompiled the app, but still get the same result.

Reinaldo.

Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: BtnBmp changed behavior?
Posted: Sun Oct 17, 2010 06:12 PM
Reinaldo

Please try modify this "ELSEIF" inside btnbmp.prg
(line 1276)

Code (fw): Select all Collapse
     elseif IsAppThemed() .or. !::lTransparent
        PalBtnPaint( ::hWnd, if( ::lMOver .and. !Empty( ::hBitmap4 ), ::hBitmap4, ::hBitmap1 ),;
                  if( ::lMOver .and. !Empty( ::hBitmap4 ), ::hPalette4, ::hPalette1 ),;
                  if ( ::lAdjust .and. empty( ::hBitmap2 ), ::hBitmap1,::hBitmap2 ),;
                  if ( ::lAdjust .and. empty( ::hBitmap2 ), ::hPalette1,::hPalette2),;
                  ::hBitmap3, ::hPalette3, ::lPressed, ::lAdjust, ::lBorder,;
                  ::oPopup != nil,;
                  ::nClrPane, if ( ::cCaption == "...", ::cCaption,) , ::nLayout,;
                  If( ::oFont != nil, ::oFont:hFont, 0 ),;
                  If( ValType( ::nClrText ) == "B", Eval( ::nClrText, ::lMOver ), ::nClrText ), ::hDC,;
                  Upper( ::oWnd:ClassName() ) != "TBAR" )


New code
Code (fw): Select all Collapse
     elseif IsAppThemed() 
        if !::lTransparent
           PalBtnPaint( ::hWnd, if( ::lMOver .and. !Empty( ::hBitmap4 ), ::hBitmap4, ::hBitmap1 ),;
                  if( ::lMOver .and. !Empty( ::hBitmap4 ), ::hPalette4, ::hPalette1 ),;
                  if ( ::lAdjust .and. empty( ::hBitmap2 ), ::hBitmap1,::hBitmap2 ),;
                  if ( ::lAdjust .and. empty( ::hBitmap2 ), ::hPalette1,::hPalette2),;
                  ::hBitmap3, ::hPalette3, ::lPressed, ::lAdjust, ::lBorder,;
                  ::oPopup != nil,;
                  ::nClrPane, if ( ::cCaption == "...", ::cCaption,) , ::nLayout,;
                  If( ::oFont != nil, ::oFont:hFont, 0 ),;
                  If( ValType( ::nClrText ) == "B", Eval( ::nClrText, ::lMOver ), ::nClrText ), ::hDC,;
                  Upper( ::oWnd:ClassName() ) != "TBAR" )
         else
            hBmpOld = SelectObject( ::hDC, hBmp )
            nZeroZeroClr = GetPixel( ::hDC, 0, 0 )
            SelectObject( ::hDC, hBmpOld )
            nOldClr = SetBkColor( ::hDC, nRGB( 255, 255, 255 ) )
            TransBmp( hBmp, nBmpWidth, nBmpHeight, nZeroZeroClr, ::hDC,;
                         if( ::lAdjust, nAdjust, nBmpLeft + nAdjust ), ;
                         if( ::lAdjust, nAdjust, nBmpTop + nAdjust ),;
                         if (::lAdjust, ::nWidth, nBmpWidth ) ,;
                         if( ::lAdjust, ::nHeight, nBmpHeight ) )
            SetBkColor( ::hDC, nOldClr )
         endif         
      else
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: BtnBmp changed behavior?
Posted: Sun Oct 17, 2010 06:20 PM

Daniel;

You got it fixed!

Thank you.

Reinaldo.

Continue the discussion