bb.donnay-software.com

Donnay Software Web Forums
It is currently Wed Dec 11, 2019 11:25 pm

All times are UTC - 7 hours




Post new topic Reply to topic  [ 15 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: CJPushButton Image
PostPosted: Fri Jun 04, 2010 8:36 am 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 822
Location: Sijsele, Belgium
Hi Roger,

If I use the IMAGE clause of cjPushButton the image isn't transparent.

This is the syntax I use:
Code:
   
@ 170,10 CJPushButton oBut1 ;
       Size 130,30 ;
       Caption fMessage(6000) ;
       ToolTip fTooltip(6000) ;
       Font '8.Arial Bold' ;
; //       TextImageRelation xtpTextBeforeImage ;
       Transparent ;
       Appearance xtpAppearanceOffice2007 ;
       Style xtpButtonNormal ;
       COLOR GRA_CLR_BLACK, GRA_CLR_WHITE ;
       Parent aWindows[1,1] ;
       ReSize DCGUI_RESIZE_RESIZEONLY ;
       Image ABO_KLANTN ;
       ACTION {|o|lHideDagb:=.T.,;
         o:=Thread():new(),o:start({||fFacturen(oDlg:drawingArea)}),dc_clearevents() }  ;
       when {|| frights("ADH") } ;
       PIXEL


ABO_KLANTN is a resource from my abo_res.DLL.

Any idea?

_________________
Best regards,

Chris.
www.aboservice.be


Top
 Profile  
 
 Post subject: Re: CJPushButton Image
PostPosted: Fri Jun 04, 2010 9:59 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4014
Location: Boise, Idaho USA
Chris -

I have a bad feeling about this.
I suspect that transparency doesn't work even though there is a membervar named :transparent in the pushbutton control.

If you look at the Pushbutton control docs, the description under the member "transparent" is the following:

Determines if the background of a TabControlPage is visible in WinXP mode.

If you click on the hyperlink under "transparent" it takes you to a description that is entirely ambiguous and not related at all to pushbuttons. I suspect that this is a feature that is misdocumented and is probably not supported.

Roger

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
 Post subject: Re: CJPushButton Image
PostPosted: Fri Jun 04, 2010 5:02 pm 
Offline
User avatar

Joined: Wed Feb 24, 2010 3:44 pm
Posts: 1150
hi,

what Type is your Image, BMP or ICO ?

i did not have that Problem with HX_Class as you can see Attachment
Attachment:
CJ_PushButton.jpg
CJ_PushButton.jpg [ 15.3 KiB | Viewed 10778 times ]


i did have a look into old XCodejock Code and saw
Code:
STATIC FUNCTION _ButtonBlock( i, aDir, nOffset )
RETURN {|o,b|o:caption := 'Appearance ' + Alltrim(Str(i)), ;
           o:appearance := i, ;
           b := DC_GetBitmap('..\..\..\bitmaps\' + aDir[i+nOffset,1]), ;
           b:transparentClr := AutomationTranslateColor(b:transparentClr,.f.), ;
           o:picture := b:getIPicture(), ;
           o:imageGap := 20, ;
           o:click := {|a,b,o|MsgBox('button ' + Alltrim(str(i)))}}
as i can see, this Function use DC_GetBitmap() and use o:picture
but there is also a Icon Property which need ImageManagerIcon.
Code:
   VAR Icon                            // Xbase++ NEW
   VAR x_Icon2
   ASSIGN METHOD _IPicture()           VAR x_Icon2
...
METHOD HX_Button:Create(...)
   //
   // ImageManagerIcon as XbpActiveXControl
   //
   ::oImgList        := XbpActiveXControl():new(,, {0,0}, {0,0} )
   ::oImgList:CLSID  := "Codejock.ImageManager"+HX_VERSION()
   ::oImgList:create()

   IF ::Icon == NIL
      ::Icon := "DUMMY.ICO"
   ENDIF
   IF ::Caption == NIL
      ::Caption := ""
   ENDIF
   IF ::preSelect == NIL
      ::preSelect := .F.
   ENDIF
   //
   // after create ?!
   //
   // ASSIGN METHOD "transfer" data
   //
   ::x_Icon2   := ::Icon
   ::x_Caption := ::Caption
   ::x_Default := ::preSelect

   ::UseVisualStyle := .T.
   //
   // set Presentation Parameter to activeX
   //
   IF .NOT. EMPTY(::aPres)
      HX_PresPara(self)
   ENDIF
   //
   //
   //
   ::Show()
RETURN self

METHOD HX_Button:_IPicture(xValue)     // COM iPicture
LOCAL lOkValue := .T.
LOCAL oLogo
LOCAL oPicture
LOCAL oIco
LOCAL lIco     := .T.
LOCAL nHandle
LOCAL oIcons
LOCAL nResource
LOCAL nCommand

IF PCOUNT() > 0
   IF ::nIcons <= 0
      ::nIcons := 1
   ELSE
      ::nIcons++
   ENDIF

   IF VALTYPE(xValue) = "C"            // STRING
      DO CASE
         CASE ".BMP" $ UPPER(xValue)
            ::oImgList:Icons:LoadBitmap(xValue,::nIcons,xtpImageNormal)
            lIco := .F.

         CASE ".ICO" $ UPPER(xValue)
            ::oImgList:Icons:LoadIcon  (xValue,::nIcons,xtpImageNormal)
      OTHERWISE
         lOkValue := .F.
      ENDCASE

   ELSEIF VALTYPE(xValue) = "N"        // Resoure ID
      oIco := HX_Icon():new():create()
      oIco:load( ::cResDLL, xValue )

      IF NIL = oIco
      ELSE
         ::setproperty("Picture", oIco:getIPicture() )
         ::nIcons++
      ENDIF
      RETURN self
   ELSE
      lOkValue := .F.
   ENDIF

   IF ::oImgList:Icons:Count() == 0
      MSGBOX("Icons "+LTRIM(STR(::oImgList:Icons:Count()))+" can not continue")
   ELSE
      IF lOkValue == .T.
        oIco := ::oImgList:Icons:GetImage(::nIcons,32)
         ::setproperty("Icon"   , oIco )
         ::nIcons++
      ENDIF
   ENDIF
ENDIF

RETURN self
as i can say, BMP have to be use ImageManagerIcon assing to Property Icon
while ICO have to load with XbpIcon() and use with Property Picture

_________________
greetings by OHR
Jimmy


Top
 Profile  
 
 Post subject: Re: CJPushButton Image
PostPosted: Sat Jun 05, 2010 2:02 am 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 822
Location: Sijsele, Belgium
Hi Jimmy,

I'm using BMP files.

I think that using that imagelist will be necessary when using Codejock. Roger succeeded to avoid this for some commands, but it seems as the use of the imagelist will solve problems as this.

_________________
Best regards,

Chris.
www.aboservice.be


Top
 Profile  
 
 Post subject: Re: CJPushButton Image
PostPosted: Sun Jun 06, 2010 11:27 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4014
Location: Boise, Idaho USA
I am misunderstanding something here.

If you run the Pushbutton sample in \exp19\XCodeJock\Samples\SuiteControls\PushButton\Pushbutton.prg, you will see that the images display correctly on the buttons with proper transparency.

What is it that you are looking to do?

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
 Post subject: Re: CJPushButton Image
PostPosted: Sun Jun 06, 2010 11:29 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4014
Location: Boise, Idaho USA
Jimmy -

The old XCodeJock code no longer is applicable.
I don't do anything that way any more.

The new XCodeJock uses the image manager.

Roger

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
 Post subject: Re: CJPushButton Image
PostPosted: Sun Jun 06, 2010 11:44 pm 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 822
Location: Sijsele, Belgium
Hi Roger,

Yes, the cjpûshbutton sample is working with transparancy. This is with the use of SuiteControlsGlobalSetting and cjLoadBitmap.

No problem for me if that is the way to use it. I thought it could maybe be done direct in one command.

_________________
Best regards,

Chris.
www.aboservice.be


Top
 Profile  
 
 Post subject: Re: CJPushButton Image
PostPosted: Mon Jun 07, 2010 12:23 am 
Offline
User avatar

Joined: Thu Jan 28, 2010 12:59 am
Posts: 749
Location: Berlin, Germany
I get transparent bitmaps as cjpushbutton captions working if the bitmap has the background color I defined with DC_BitmapTransparentColor. If I use icons, there is no transparency, whatever I do.

_________________
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."


Top
 Profile  
 
 Post subject: Re: CJPushButton Image
PostPosted: Mon Jun 07, 2010 7:07 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4014
Location: Boise, Idaho USA
Ok, now I understand.

It may be possible to do it in one command.
I will check into this.

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
 Post subject: Re: CJPushButton Image
PostPosted: Mon Jun 14, 2010 12:51 am 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 822
Location: Sijsele, Belgium
Hi Roger,

Did you find the time to check this?

_________________
Best regards,

Chris.
www.aboservice.be


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ]  Go to page 1, 2  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group