Page 1 of 1

cellFontSize private to public on ODGrid?

Posted: Sat Jan 28, 2017 1:55 pm
by wjstarck
Could cellFontSize on OpenDentBusiness.ODGrid be made public so I can access it?

I need to supersize all the controls on a form (including an ODGrid) so they can me used more easily with a touchscreen

Code: Select all

public Font FontForSheets;
private float cellFontSize = 8.5f;  <---------------
protected int titleHeight=18;
private int headerHeight=15;
I want to enlarge all of the OD controls about 3x so they are useful, like so:

Image

Otherwise, it's gonna look like this: :roll:

Image

The controls on the underlying parent window are the normal sized OD controls

Thanks.

Re: cellFontSize private to public on ODGrid?

Posted: Mon Jan 30, 2017 8:52 am
by jsalmon
We should be able to do that for you relatively soon.

Re: cellFontSize private to public on ODGrid?

Posted: Tue Feb 07, 2017 2:45 pm
by wjstarck
Thanks.

While we're at it, is there any harm in uncommenting these two and making them public as well?

Code: Select all

private string title;
public Font titleFont=new Font(FontFamily.GenericSansSerif,8.5f,FontStyle.Bold); <-------------
public Font headerFont=new Font(FontFamily.GenericSansSerif,8.5f,FontStyle.Bold); <--------------
//private Font cellFont=new Font(FontFamily.GenericSansSerif,8.5f);
public Font FontForSheets;
The grid looks a little silly with super-sized cells but Sans Serif 8.5 Title and column headers

Re: cellFontSize private to public on ODGrid?

Posted: Wed Feb 08, 2017 2:53 pm
by jsalmon
We'll go ahead and turn them all into properties for you so that it is easier to edit within the designer as well.

Re: cellFontSize private to public on ODGrid?

Posted: Wed Feb 08, 2017 3:03 pm
by wjstarck
Super, thanks

Re: cellFontSize private to public on ODGrid?

Posted: Thu Feb 09, 2017 3:41 pm
by allends

Code: Select all

private Font _titleFont=new Font(FontFamily.GenericSansSerif,8.5f,FontStyle.Bold); <-------------
private Font _headerFont=new Font(FontFamily.GenericSansSerif,8.5f,FontStyle.Bold); <--------------
private Font _cellFont=new Font(FontFamily.GenericSansSerif,8.5f);
These have been uncommented and made into public properties
TitleFont
HeaderFont
CellFont

This will be available in 16.4.21

Re: cellFontSize private to public on ODGrid?

Posted: Sat Feb 11, 2017 8:11 am
by wjstarck
Fantastic, thanks.

Looks great now:

Image

Too bad I can't do anything with the WinForm title text size :(

Re: cellFontSize private to public on ODGrid?

Posted: Sat Feb 11, 2017 11:47 am
by Erik@AD
Here are two things that stick out to me:
  • The large timer in the top right is the only one that does not have "AM".
  • You have "Anesthetic medication" and "Anesthetic Medication".
I see a few more things, but I have no idea if you even care about these two.

-Erik

Re: cellFontSize private to public on ODGrid?

Posted: Sun Feb 12, 2017 1:38 pm
by wjstarck
Erik@AD wrote:The large timer in the top right is the only one that does not have "AM".
Yes, that's by design (well sort of)

I mainly put that feature in for myself, as I was always squinting at the Lilliputian clock in the Windows taskbar. I'd have to make the clock longer to accomodate the AM/PM, and to do that I'd have to widen the form, which throws off the balance of the layout. That time is hidden when the form is printed anyways to avoid confustion, since the form might be printed well after the case is finished. And I figured everyone knows whether it's AM or PM when they're doing a case anyways, so the AM/PM is superfluous

Erik@AD wrote:You have "Anesthetic medication" and "Anesthetic Medication".
Good catch. I've been reworking the form for many years and never saw that. Thanks.

Re: cellFontSize private to public on ODGrid?

Posted: Wed Oct 16, 2019 3:32 pm
by wjstarck
Oops, was cellFont made private again in 19.3 ?

Suddenly that form looks like poo again because I can't change the cellFont in the grid anymore so it's badly out of scale. Or did that get moved somewhere else?

Re: cellFontSize private to public on ODGrid?

Posted: Thu Oct 17, 2019 7:27 am
by cmcgehee
We did a big refactor in ODGrid in 19.3. It looks like cellFont was renamed to _fontCell. The fastest way to fix this for you would be to use reflection to set it. If you don't want to do that, I can initiate the process to get it changed to public.

Re: cellFontSize private to public on ODGrid?

Posted: Thu Oct 17, 2019 8:18 am
by jordansparks
That was me. I wasn't aware of the history, and there were no comments in the code about why it was that way. All I saw was unnecessary clutter that was making my math and object reuse overly complicated and buggy. Since we never change the font sizes within OD, I had to get rid of it. The grid was starting to get bloated, slow, and glitchy, so cleaning up stuff like this is always the first step. In general, all of our controls are customized and optimized to be very specific to exactly how they are used within OD proper, and I'm getting more and more strict about not allowing the slightest bit of clutter. It's very important for the stability of the software. I'm only about half-way done with the overhaul of the grid. I'm trying to lay a strong foundation for the future. Microsoft has built-in grids that you can use instead of the OD grid. Another option would be to make a copy of our grid and fork it to add your own font sizes. I've forked the grid for a number of other projects where I want to use it outside of OD. Sorry.

Re: cellFontSize private to public on ODGrid?

Posted: Thu Oct 17, 2019 10:54 am
by wjstarck
Forking ODGrid here seems pretty reasonable will go that route.

Good to see you back on the forum :D

Re: cellFontSize private to public on ODGrid?

Posted: Mon Nov 11, 2019 4:51 pm
by jordansparks
You could even fork a slightly older version of the grid that still had support for the different font sizes.