BtnBmp changed behavior?

BtnBmp changed behavior?

Postby reinaldocrespo » Thu Oct 14, 2010 4: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:

Image

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


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: BtnBmp changed behavior?

Postby reinaldocrespo » 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.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: BtnBmp changed behavior?

Postby James Bott » 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=3&t=19966

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

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: BtnBmp changed behavior?

Postby reinaldocrespo » 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.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: BtnBmp changed behavior?

Postby James Bott » Fri Oct 15, 2010 1: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: BtnBmp changed behavior?

Postby Antonio Linares » Fri Oct 15, 2010 6: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: BtnBmp changed behavior?

Postby reinaldocrespo » Fri Oct 15, 2010 7:46 pm

Antonio;

Hi.

First this is the code:
Code: Select all  Expand view  RUN
    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.
Image

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

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.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: BtnBmp changed behavior?

Postby Gale FORd » 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.
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Re: BtnBmp changed behavior?

Postby reinaldocrespo » 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.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: BtnBmp changed behavior?

Postby Antonio Linares » Sat Oct 16, 2010 6:43 am

Reinaldo,

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

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

Re: BtnBmp changed behavior?

Postby reinaldocrespo » Sat Oct 16, 2010 5:30 pm

Hi.

The RC section for the dialog is:
Code: Select all  Expand view  RUN
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.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: BtnBmp changed behavior?

Postby Antonio Linares » Sun Oct 17, 2010 8:24 am

Reinaldo,

What is 0xF0B ?

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

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

Re: BtnBmp changed behavior?

Postby reinaldocrespo » Sun Oct 17, 2010 3: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.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: BtnBmp changed behavior?

Postby Daniel Garcia-Gil » Sun Oct 17, 2010 6:12 pm

Reinaldo

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

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

     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
 
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: BtnBmp changed behavior?

Postby reinaldocrespo » Sun Oct 17, 2010 6:20 pm

Daniel;

You got it fixed!

Thank you.


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 12 guests