bitmaps on xbrowse field

bitmaps on xbrowse field

Postby Silvio » Wed Jan 31, 2007 1:34 am

I must insert a bitmap for each opzione of this column :
Code: Select all  Expand view

                                         oCol:= oApp():oGrid:AddCol()
                                          oCol:AddResource("SEL1")
                                          oCol:AddResource("SEL2")
                                          oCol:AddResource("SEL3")
                                          oCol:AddResource("SEL4")

  oCol:bStrData := { || SOCI->ATTIVITA}
oCol:cHeader  := "Professione"
                                          oCol:bEditValue := { || SOCI->ATTIVITA }
                                          oCol:nDataStyle := oCol:DefStyle( AL_LEFT, .T.)
                                          oCol:nEditType := EDIT_LISTBOX
                                                                                    oCol:aEditListTxt   := { "Docente","ATA","Alunno/a","Esterno"}
                                          oCol:aEditListBound := { "Docente","ATA","Alunno/a","Esterno" }
                                          oCol:bOnPostEdit := {|o, v| iif( v != NIL, SOCI->ATTIVITA := v,) }
                                          oCol:nWidth   := 160


How I can make ?
I try with


Code: Select all  Expand view
oCol:bBmpData   := { || iif( SOCI->Attivita, 1, 2) }


but it is good for the first and second option and How I must make for all option ?


thanks in advance
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Frank Demont » Wed Jan 31, 2007 7:41 am

Silvio

If you have 4 bitmaps in a column , bBpmData should return a number between 1 and 4 , not 1 and 2 .

oCol:bBmpData := { || iif( SOCI->Attivita, 1, 2)}

Frank
Frank Demont
 
Posts: 142
Joined: Sun Oct 09, 2005 10:59 am

Postby Silvio » Wed Jan 31, 2007 8:53 am

yes I want to show all the bitmaps

if soci->attivita = 1 -> sel1
if soci->attivita =2 ->sel2
if soci->attivita = 3-> sel3
if soci->attivita = 4 -> sel4


I hope U understand me
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Frank Demont » Wed Jan 31, 2007 1:52 pm

oCol:bBmpData := { || SOCI->Attivita} ????????
Frank Demont
 
Posts: 142
Joined: Sun Oct 09, 2005 10:59 am

Postby Silvio » Wed Jan 31, 2007 4:48 pm

I TRYED ALREADY WITH IT BUT

Stack Calls
===========
Called from: pcustomer.prg => (b)SOCI(300)
Called from: XBrwcol.prg => TXBRWCOLUMN:POSTEDIT(1544)
Called from: XBrwcol.prg => (b)TXBRWCOLUMN:SHOWBTNLIST(1467)
Called from: window.prg => TWINDOW:LBUTTONUP(1743)
Called from: CONTROL.PRG => TCONTROL:LBUTTONUP(0)
Called from: listbox.PRG => TLISTBOX:LBUTTONUP(0)
Called from: window.prg => TWINDOW:HANDLEEVENT(0)
Called from: CONTROL.PRG => TCONTROL:HANDLEEVENT(0)
Called from: listbox.PRG => TLISTBOX:HANDLEEVENT(0)
Called from: window.prg => _FWH(3165)
Called from: => WINRUN(0)
Called from: window.prg => TWINDOW:ACTIVATE(883)
Called from: main.prg => TAPPLICATION:ACTIVATE(164)
Called from: main.prg => MAIN(42)
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Silvio » Wed Jan 31, 2007 4:49 pm

Code: Select all  Expand view
  oCol:= oApp():oGrid:AddCol()
                                          oCol:AddResource("BR_SEL1")
                                          oCol:AddResource("BR_SEL2")
                                          oCol:AddResource("sort1")
                                          oCol:AddResource("sort2")
                                          oCol:bStrData := { || SOCI->ATTIVITA}
                                          oCol:cHeader  := "Professione"
                                          oCol:bEditValue := { || SOCI->ATTIVITA }
                                          oCol:nDataStyle := oCol:DefStyle( AL_LEFT, .T.)
                                          oCol:nEditType := EDIT_LISTBOX
                                          oCol:bBmpData := { || SOCI->Attivita}
                                                                                   oCol:aEditListTxt   := { "Docente","ATA","Alunno/a","Esterno"}
                                          oCol:aEditListBound := { "Docente","ATA","Alunno/a","Esterno" }
                                          oCol:bOnPostEdit := {|o, v| iif( v != NIL, SOCI->ATTIVITA := v,) }
                                          oCol:nWidth   := 160



THI IS THE CODE .... BUT NOT RUN OK

SOCI->ATTIVITA ID NUMBER FIELD n 1
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby José Luis Sánchez » Wed Jan 31, 2007 8:42 pm

Silvio: look this code:
Code: Select all  Expand view
   oCol := oApp():oGrid:AddCol()
   oCol:AddResource("BR_EPOCA0000")
   oCol:AddResource("BR_EPOCA0001")
   oCol:AddResource("BR_EPOCA0010")
   oCol:AddResource("BR_EPOCA0011")
   oCol:AddResource("BR_EPOCA0100")
   oCol:AddResource("BR_EPOCA0101")
   oCol:AddResource("BR_EPOCA0110")
   oCol:AddResource("BR_EPOCA0111")
   oCol:AddResource("BR_EPOCA1000")
   oCol:AddResource("BR_EPOCA1001")
   oCol:AddResource("BR_EPOCA1010")
   oCol:AddResource("BR_EPOCA1011")
   oCol:AddResource("BR_EPOCA1100")
   oCol:AddResource("BR_EPOCA1101")
   oCol:AddResource("BR_EPOCA1110")
   oCol:AddResource("BR_EPOCA1111")
   oCol:cHeader       := i18n("Epoca")
   oCol:bBmpData      := { || MAX(ASCAN(aEpoca,STRTRAN(STR(RE->ReEpoca,4),' ','0')),1) }
   oCol:nWidth        := 35
   oCol:nDataBmpAlign := 2
User avatar
José Luis Sánchez
 
Posts: 556
Joined: Thu Oct 13, 2005 9:23 am
Location: Novelda - Alicante - España

Postby Silvio » Wed Jan 31, 2007 10:02 pm

thanks I resolve it

Dear José Luis Sánchez,
can I create a combobox list with bitmaps from grid ?



Code: Select all  Expand view
                                          oCol:= oApp():oGrid:AddCol()
                                          oCol:AddResource("IMG39")
                                          oCol:AddResource("IMG50")
                                          oCol:AddResource("IMG03")
                                          oCol:AddResource("IMG02")
                                          oCol:bStrData := { || SOCI->TIPO}
                                          oCol:cHeader  := "Adesione"
                                          oCol:bEditValue := { || SOCI->TIPO }
                                          oCol:nDataStyle := oCol:DefStyle( AL_LEFT, .T.)
                                          oCol:nEditType := EDIT_LISTBOX
                                          oCol:bBmpData := { || SOCI->TIPO}
                                          oCol:aEditListTxt   := { "Fondatore","Ordinario","Simpatizzante","Servizi"}
                                          oCol:aEditListBound := { 1,2,3,4 }
                                          oCol:bOnPostEdit := {|o, v| iif( v != NIL, SOCI->TIPO := v,) }
                                          oCol:nWidth   := 50





now I can set bitmaps but when I click there are not bitmaps into listbox



----------------------------------------------------------------------------

Another question

can I insert a control datepick in grid as the listbox ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby José Luis Sánchez » Thu Feb 01, 2007 7:11 am

I don't know if the features you request are available on xbrowse. I use the xbrowse to show the records, and allways edit them in a separated form.

Regards,
User avatar
José Luis Sánchez
 
Posts: 556
Joined: Thu Oct 13, 2005 9:23 am
Location: Novelda - Alicante - España


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Enrico Maria Giordano, Google [Bot] and 53 guests