April 19, 2024, 12:57:37 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


IWGrid headers

Started by Brian, September 07, 2013, 10:39:53 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Brian

September 07, 2013, 10:39:53 AM Last Edit: September 07, 2013, 11:23:41 AM by Brian Pugh
Larry,

Messing a bit with IWGrid - is there any way to change the text of the headers?
Rather than A, B, C, etc, could I have "Col 1", "Col 2", "Col 3", for example?

And how do I go about saving the contents of cells so that you could re-load
them on program startup?

Brian

Edit: Just noticed - if you have ShowRowNumbers on, clicking on a row number
does not highlight the whole line, as you would expect it to do if you have
also set SetHiLightRow to on

LarryMc

Quote from: Brian Pugh on September 07, 2013, 10:39:53 AM
Messing a bit with IWGrid - is there any way to change the text of the headers?
Rather than A, B, C, etc, could I have "Col 1", "Col 2", "Col 3", for example?
IWG_Create(main, "", 20,30,600,340, 501)
IWG_ShowHeader(main,501, 1)
IWG_AutoNumberHeader(main,501, 0)
IWG_InitCellDat(main, 501, 0, 1, "Col 1",@IWGLABEL,0)
IWG_InitCellDat(main, 501, 0, 2, "Col 2",@IWGLABEL,0)
IWG_InitCellDat(main, 501, 0, 3, "Col 3",@IWGLABEL,0)
IWG_InitCellDat(main, 501, 0, 4, "Col 4",@IWGLABEL,0)



Quote from: Brian Pugh on September 07, 2013, 10:39:53 AM
And how do I go about saving the contents of cells so that you could re-load
them on program startup?
for every cell you want to save
   a$=IWG_GetCellDat(main, 501, r, c)
   write r, c, a$ to a file

on startup
init all the cells
   IWG_InitCellDat(main, 501, r, c, "", celltype, flags)
then read file
   into a$, r, c
   IWG_SetCellDat(main, 501, r, c, a$)


Quote from: Brian Pugh on September 07, 2013, 10:39:53 AM
Just noticed - if you have ShowRowNumbers on, clicking on a row number
does not highlight the whole line, as you would expect it to do if you have
also set SetHiLightRow to on
SetHiLightRow highlights the row that contains the currently selected cell
the row number column cells can't be selected for editing so that's why it works the way it does right now.
I'll look in to seeing if I can make it work the way you say without trashing all my code thus far.
It will probably result in me forcing it to select column A when you click on the row number

thanks for the feedback.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Brian

Silly Billy - never saw the InitCellDat bit. Was looking for a specific command,
like the Listview one

Right, on we go - many thanks, Larry

Brian