Hello everyone;
Can I show more than one single bmp on an xbrowse column object?
Thank you,
Reinaldo.
more than 1 bmp on a xbrowse column
- reinaldocrespo
- Posts: 979
- Joined: Thu Nov 17, 2005 5:49 pm
- Location: Fort Lauderdale, FL
Re: more than 1 bmp on a xbrowse column
Reinaldo, what would be the use of that necessity?
Why not two columns with a bmp in each one?
Or one with different bmp according to the needs?
It is just out of curiosity...
Why not two columns with a bmp in each one?
Or one with different bmp according to the needs?
It is just out of curiosity...
- nageswaragunupudi
- Posts: 10691
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: more than 1 bmp on a xbrowse column
This is one of the few ways:
Code: Select all | Expand
// xbrbtns.prg
#include "fivewin.ch"
function Main()
local oDlg, oFont, oBrw, oBrush
USE CUSTOMER
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
DEFINE DIALOG oDlg SIZE 500,400 PIXEL TRUEPIXEL FONT oFont RESIZABLE
@ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
DATASOURCE "CUSTOMER" ;
COLUMNS "FIRST", "AGE", "SALARY" ;
LINES NOBORDER
WITH OBJECT oBrw
:nRowHeight := 30
WITH OBJECT :Age
:nWidth := 100
:nDataStrAlign := AL_CENTER
:nHeadStrAlign := AL_CENTER
:AddBitmap( { FW_BmpPlus( nil, { CLR_WHITE, CLR_GREEN } ), FW_BmpMinus() } )
// Right Button
:nEditType := EDIT_BUTTON
:bEditBlock := { |r,c,oCol| oCol:Value + 1 }
:nBtnBmp := 1
:lBtnTransparent := .t.
// Left Button
:bBmpData := { |v,lSel| If( lSel, 2, 0 ) }
:bBmpAction := { |oCol| oCol:VarPut( oCol:Value - 1 ) }
END
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
return nil
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 10691
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: more than 1 bmp on a xbrowse column
Second way is to use
1. bBmpData (left or right align)
2. bStrImage (any position)
3. Text any position
Lastly, paint the column on our own using either oBrw:bPaintRow or oCol:bPaintText
I will provide a sample if required
1. bBmpData (left or right align)
2. bStrImage (any position)
3. Text any position
Lastly, paint the column on our own using either oBrw:bPaintRow or oCol:bPaintText
I will provide a sample if required
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- RAMESHBABU
- Posts: 626
- Joined: Fri Oct 21, 2005 5:54 am
- Location: Secunderabad (T.S), India
Re: more than 1 bmp on a xbrowse column
Dear Rao gaaru,
As usually, an excellent example of buttons in xBrowser Columns.
-Ramesh Babu
As usually, an excellent example of buttons in xBrowser Columns.
-Ramesh Babu
- nageswaragunupudi
- Posts: 10691
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: more than 1 bmp on a xbrowse column
Dear Ramesh Babu
Actually, I posted that sample in a haste.
Later I realized that it is not what he is looking for.
I will post different samples now.
Actually, I posted that sample in a haste.
Later I realized that it is not what he is looking for.
I will post different samples now.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- reinaldocrespo
- Posts: 979
- Joined: Thu Nov 17, 2005 5:49 pm
- Location: Fort Lauderdale, FL
Re: more than 1 bmp on a xbrowse column
Mr Rao -- let me first say: he he he.
"In a haste" but excellent example and clever use of the right side button. It takes imagination to see in how many ways painting various bmps on a cell can be not just beautiful but also very useful.
I have seen it on grids where tags (like stack overflow tags) are shown.
Yes, it would help to see sample code using oCol:bPaintText to paint various bmps based on conditions.
Thank you,
Reinaldo.
"In a haste" but excellent example and clever use of the right side button. It takes imagination to see in how many ways painting various bmps on a cell can be not just beautiful but also very useful.
I have seen it on grids where tags (like stack overflow tags) are shown.
Yes, it would help to see sample code using oCol:bPaintText to paint various bmps based on conditions.
Thank you,
Reinaldo.