Page 1 of 1
how to align numerical cells of a ListIcon to the right?
Posted: Sat Nov 26, 2011 2:54 pm
by morosh
Hello:
In a ListIcon gadget, I prefer that cells containing numerical values, are aligned to the right.
is this possible??
thank you
Re: how to align numerical cells of a ListIcon to the right?
Posted: Sat Nov 26, 2011 11:03 pm
by IdeasVacuum
If on Windows, you could use gonzal's PureLVSORT lib (which has many excellent functions):
Code: Select all
PureLVSORT_SetColumnAlignment(#MyListIconGadget,NumberColumn,#PureLVSORT_Right)
Re: how to align numerical cells of a ListIcon to the right?
Posted: Sat Nov 26, 2011 11:12 pm
by Paul
This is also available in the PureVision package using the included PV_Gadgets library...
The command is PVGadgets_JustifyListIconColumn()
This of course is a wrapper for Windows API ...
Code: Select all
ProcedureDLL.l JustifyListIconColumn(GadgetID.l,column.l,flag.l) ;Justify ListIcon Column 0-Left 1-Right 2-Center
lvc.LV_COLUMN
lvc\Mask = #LVCF_FMT
Select flag
Case 1
lvc\fmt=#LVCFMT_RIGHT
Case 2
lvc\fmt=#LVCFMT_CENTER
Default
lvc\fmt=#LVCFMT_LEFT
EndSelect
ProcedureReturn SendMessage_(GadgetID(GadgetID),#LVM_SETCOLUMN,column,@lvc)
EndProcedure
Re: how to align numerical cells of a ListIcon to the right?
Posted: Sun Nov 27, 2011 10:35 am
by morosh
Thank you; both
Re: how to align numerical cells of a ListIcon to the right?
Posted: Sun Nov 27, 2011 9:04 pm
by netmaestro
Thanks Paul, I didn't know this listview message before.
Re: how to align numerical cells of a ListIcon to the right?
Posted: Sun Nov 27, 2011 10:17 pm
by Shardik
For a cross-platform solution (Windows and Linux) take a look
into this code example:
http://www.purebasic.fr/english/viewtop ... 31&start=3