bitmap for nEditType EDIT_BUTTON

bitmap for nEditType EDIT_BUTTON

Postby Detlef » Wed Sep 28, 2022 8: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: Select all  Expand view
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
Last edited by Detlef on Wed Sep 28, 2022 9:58 am, edited 1 time in total.
User avatar
Detlef
 
Posts: 205
Joined: Mon Feb 07, 2022 9:54 pm

Re: bitmap for nEditType EDIT_BUTTON

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

Re: bitmap for nEditType EDIT_BUTTON

Postby Detlef » Wed Sep 28, 2022 9: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
User avatar
Detlef
 
Posts: 205
Joined: Mon Feb 07, 2022 9:54 pm

Re: bitmap for nEditType EDIT_BUTTON

Postby Antonio Linares » Wed Sep 28, 2022 1:53 pm

very good :-)
regards, saludos

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

Re: bitmap for nEditType EDIT_BUTTON

Postby nageswaragunupudi » Wed Sep 28, 2022 5:25 pm

Recommended way:
Code: Select all  Expand view
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
User avatar
nageswaragunupudi
 
Posts: 10308
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 40 guests