cellFontSize private to public on ODGrid?

This forum is for programmers who have questions about the source code.
Post Reply
User avatar
wjstarck
Posts: 935
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

cellFontSize private to public on ODGrid?

Post by wjstarck » Sat Jan 28, 2017 1:55 pm

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.
Last edited by wjstarck on Sat Feb 11, 2017 8:09 am, edited 1 time in total.
Cheers,

Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA

User avatar
jsalmon
Posts: 1551
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: cellFontSize private to public on ODGrid?

Post by jsalmon » Mon Jan 30, 2017 8:52 am

We should be able to do that for you relatively soon.
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

User avatar
wjstarck
Posts: 935
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Re: cellFontSize private to public on ODGrid?

Post by wjstarck » Tue Feb 07, 2017 2:45 pm

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
Cheers,

Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA

User avatar
jsalmon
Posts: 1551
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: cellFontSize private to public on ODGrid?

Post by jsalmon » Wed Feb 08, 2017 2:53 pm

We'll go ahead and turn them all into properties for you so that it is easier to edit within the designer as well.
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

User avatar
wjstarck
Posts: 935
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Re: cellFontSize private to public on ODGrid?

Post by wjstarck » Wed Feb 08, 2017 3:03 pm

Super, thanks
Cheers,

Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA

allends
Posts: 235
Joined: Fri Aug 23, 2013 11:29 am

Re: cellFontSize private to public on ODGrid?

Post by allends » Thu Feb 09, 2017 3:41 pm

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
Allen
Open Dental Software
http://www.opendental.com

User avatar
wjstarck
Posts: 935
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Re: cellFontSize private to public on ODGrid?

Post by wjstarck » Sat Feb 11, 2017 8:11 am

Fantastic, thanks.

Looks great now:

Image

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

Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA

Erik@AD
Posts: 15
Joined: Thu Jun 09, 2016 12:52 pm

Re: cellFontSize private to public on ODGrid?

Post by Erik@AD » Sat Feb 11, 2017 11:47 am

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

User avatar
wjstarck
Posts: 935
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Re: cellFontSize private to public on ODGrid?

Post by wjstarck » Sun Feb 12, 2017 1:38 pm

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.
Cheers,

Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA

User avatar
wjstarck
Posts: 935
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Re: cellFontSize private to public on ODGrid?

Post by wjstarck » Wed Oct 16, 2019 3:32 pm

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?
Cheers,

Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA

User avatar
cmcgehee
Posts: 711
Joined: Tue Aug 25, 2015 5:06 pm
Location: Salem, Oregon

Re: cellFontSize private to public on ODGrid?

Post by cmcgehee » Thu Oct 17, 2019 7:27 am

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.
Chris McGehee
Open Dental Software
http://www.opendental.com

User avatar
jordansparks
Site Admin
Posts: 5739
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: cellFontSize private to public on ODGrid?

Post by jordansparks » Thu Oct 17, 2019 8:18 am

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.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
wjstarck
Posts: 935
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Re: cellFontSize private to public on ODGrid?

Post by wjstarck » Thu Oct 17, 2019 10:54 am

Forking ODGrid here seems pretty reasonable will go that route.

Good to see you back on the forum :D
Cheers,

Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA

User avatar
jordansparks
Site Admin
Posts: 5739
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: cellFontSize private to public on ODGrid?

Post by jordansparks » Mon Nov 11, 2019 4:51 pm

You could even fork a slightly older version of the grid that still had support for the different font sizes.
Jordan Sparks, DMD
http://www.opendental.com

Post Reply