March 29, 2024, 08:46:04 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Font of row header

Started by RitchieF, November 22, 2014, 11:10:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RitchieF

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

Brian

This should do it:

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

Brian

RitchieF

November 22, 2014, 11:56:30 AM #2 Last Edit: November 22, 2014, 12:15:26 PM by RitchieF
Thanks Brian but doesn't work ,
still shows the symbol font.
Row header and cells use the same font.

Richard

LarryMc

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
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

RitchieF

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

LarryMc

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.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

RitchieF

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

LarryMc

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.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

RitchieF

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

LarryMc

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.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

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.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

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