IonicWind Software

IWBasic => IWGrid => IWGrid Issues => Topic started by: RitchieF on November 22, 2014, 11:10:18 AM

Title: Font of row header
Post by: RitchieF on November 22, 2014, 11:10:18 AM
Larry, since I'm using a symbol font in the cells I can't show the row header coz of using the same font .
Any way to change the row header font in your source code ?

Thanks,
Richard
Title: Re: Font of row header
Post by: Brian on November 22, 2014, 11:20:44 AM
This should do it:

   IWG_SetFont(win,501,@IWGHEADERFONT,"Arial",8,800,0)

Brian
Title: Re: Font of row header
Post by: RitchieF on November 22, 2014, 11:56:30 AM
Thanks Brian but doesn't work ,
still shows the symbol font.
Row header and cells use the same font.

Richard
Title: Re: Font of row header
Post by: LarryMc on November 22, 2014, 04:56:12 PM
Quote from: RitchieF on November 22, 2014, 11:56:30 AM
Thanks Brian but doesn't work ,
still shows the symbol font.
Row header and cells use the same font.

Richard
Download the latest version of IWGrid
Title: Re: Font of row header
Post by: RitchieF on November 23, 2014, 02:53:58 AM
Looks like I misunderstand the definition of rows and columns.

As you see in the screenshot the row headers have the same font like the cells  and this I'd like to change.
I can change the font of the letters running horizontal ( = column head for me) but not the font of the numbers running vertical ( = row header for me).

Am I wrong ?

Richard
Title: Re: Font of row header
Post by: LarryMc on November 23, 2014, 05:38:04 AM
Sorry for my confusion.  I was seeing the word "header" and my brain was totally ignoring the word "row" in front of it.
And I don't think I refer to that column as a row header anywhere in the docs(but I may be wrong) ;)

The row number column and the rest of the cells use the same font so that the row height doesn't go haywire.
But there is a workaround.

You can hide the row numbers with
IWG_ShowRowNumbers(main, 501, 0)
And if you need row numbers you can
   hide the row number column
   add a column on the left side
   set the font of all the cells in that column to a regular font with a size that looks right
   loaded the cells with row numbers.
If you do the above AND you are using auto-labeled column headers then you will need to create the column headers yourself. Do it by using
IWG_AutoNumberHeader(win, ID_GRID1, 0)to turn the auto headers off and then use InitCell to place your column headers' text in the appropriate places remembering to not place anything in the column header row for the column with the fake row numbers.
Hope that makes sense.  Let me know if I need to make an example.
Title: Re: Font of row header
Post by: RitchieF on November 23, 2014, 06:21:09 AM
Larry no need to say sorry. You're simply not right as rain after your surgery. (I hope this is the correct idiom ;))

Your workaround is clever and it works. To protect the first column from editing I added
Quotefor i = 1 to IWG_GetRows(main, 502)
IWG_SetCellProt(main,502, i, 0, 1)
next i
but protection doesn't work. Must I enable IWG_EnableEditDialog(main,502,0) again to make this work ?

Thanks,

Richard
Title: Re: Font of row header
Post by: LarryMc on November 23, 2014, 06:25:17 AM
Initialize the faux row number cells as @IWGLABEL and they can't be edited or selected.
That way you don't have to worry about protection.
Title: Re: Font of row header
Post by: RitchieF on November 23, 2014, 07:09:37 AM
Quoteset the font of all the cells in that column to a regular font with a size that looks right

How to set the font of a single cell or here column different from the rest of the cells?

Richard
Title: Re: Font of row header
Post by: LarryMc on November 23, 2014, 07:26:51 AM
Quote from: RitchieF on November 23, 2014, 07:09:37 AM
How to set the font of a single cell or here column different from the rest of the cells?
Good question.  You can't. ::)

Let me think a minute and see if I can come up with a "workable" work around.

OK
There's no workaround
I think I can modify the code pretty quick to allow having a different font in the row column.
working on it now.
Title: Re: Font of row header
Post by: LarryMc on November 23, 2014, 07:54:36 AM
OK I got it where you can set a different font to the row number column.
Give me a bit to update the help file and rebuild the download package.
Title: Re: Font of row header
Post by: LarryMc on November 23, 2014, 08:12:43 AM
Richard
check your email