bitmap for nEditType EDIT_BUTTON

Post Reply
User avatar
Detlef
Posts: 209
Joined: Mon Feb 07, 2022 9:54 pm

bitmap for nEditType EDIT_BUTTON

Post by Detlef »

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

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
Antonio Linares
Site Admin
Posts: 42595
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 38 times
Been thanked: 86 times
Contact:

Re: bitmap for nEditType EDIT_BUTTON

Post by Antonio Linares »

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
Detlef
Posts: 209
Joined: Mon Feb 07, 2022 9:54 pm

Re: bitmap for nEditType EDIT_BUTTON

Post by Detlef »

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
Antonio Linares
Site Admin
Posts: 42595
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 38 times
Been thanked: 86 times
Contact:

Re: bitmap for nEditType EDIT_BUTTON

Post by Antonio Linares »

very good :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: bitmap for nEditType EDIT_BUTTON

Post by nageswaragunupudi »

Recommended way:

Code: Select all | Expand

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
Post Reply