FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour bitmap for nEditType EDIT_BUTTON
Posts: 218
Joined: Mon Feb 07, 2022 09:54 PM
bitmap for nEditType EDIT_BUTTON
Posted: Wed Sep 28, 2022 08:27 AM
I want to exchange the bitmap which is shown when I have a xBrowse column with nEditType EDIT_BUTTON.
My try was
Code (fw): Select all Collapse
WITH OBJECT oBrw:aCols[ 1 ]
      :oBtnElip:SetText( "" )
      :oBtnElip:LoadBitmaps( "find16" )
      :nEditType  := EDIT_BUTTON
      :bEditBlock := { | nRow, nCol, oCol, nKey | dGetCal( oCol ) }
   END

But this gives me the error that oBrw:aCol[1]:oBtnElip is NIL.

I can't find out what I'm doing wrong.
Has anyone an idea?
Thanks, Detlef
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: bitmap for nEditType EDIT_BUTTON
Posted: Wed Sep 28, 2022 08:54 AM

Dear Detlef,

A possible suggestion is that the xbrowse is not built yet.

Once created, then you will be able to modify those properties

Just guessing...

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 218
Joined: Mon Feb 07, 2022 09:54 PM
Re: bitmap for nEditType EDIT_BUTTON
Posted: Wed Sep 28, 2022 09:57 AM

Dear Antonio,

as usual you guessed right. :D
I had to put my code into the ON INIT clause of the dialog and then it works.

Many thanks
Detlef

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: bitmap for nEditType EDIT_BUTTON
Posted: Wed Sep 28, 2022 01:53 PM

very good :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: bitmap for nEditType EDIT_BUTTON
Posted: Wed Sep 28, 2022 05:25 PM
Recommended way:
Code (fw): Select all Collapse
function somename()

   local oDlg, oBrw

   USE STATES

   DEFINE DIALOG oDlg SIZE 400,400 PIXEL TRUEPIXEL RESIZABLE

   @ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE "STATES" ;
      COLUMNS "Code", "Name" ;
      CELL LINES NOBORDER

   WITH OBJECT oBrw
      WITH OBJECT :aCols[ 2 ]
         :nEditType  := EDIT_BUTTON
         :nBtnBmp    := :AddBitmap( "EDIT" )
         :bEditBlock := { | nRow, nCol, oCol, nKey | MsgInfo( "edit" ), nil }
      END
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED

return nil

Syntax
oCol:AddBitmap( uImage, [aResize] ) --> nBmpSerialNumber
uImage can be bmpfile, anyimage file, resource,anyimagebuf, etc.
aResize Optionally resize {w,h}
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion