View Single Post
  #6   Spotlight this post!  
Unread 03-05-2012, 22:27
Djur's Avatar
Djur Djur is offline
WPILib
AKA: Sam Carlberg
no team
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2009
Location: Massachusetts
Posts: 182
Djur will become famous soon enough
Re: SmartDashboard Window size not saving

The problem seems to be at DashboardFrame.java at line 119:
Code:
// Set the size / look
        if (competition) {
            setPreferredSize(NETBOOK_SIZE); //1024x400 - this is your problem
            setUndecorated(true);
            setLocation(0, 0);
            setResizable(false);
        } else {
            setMinimumSize(MINIMUM_SIZE); //300x200

            // Closing operation is handled manually
            setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);

            DashboardPrefs prefs = DashboardPrefs.getInstance();
            setPreferredSize(new Dimension(prefs.width.getValue(), prefs.height.getValue())); //This is the dimension stored in the save file
            setLocation(prefs.x.getValue(), prefs.y.getValue());
        }
So the DashboardFrame will automatically be set to 1024x800 if you're in competition mode. The easiest (temporary) fix until the 2013 release would be to change
Code:
setPreferredSize(NETBOOK_SIZE);
to
Code:
setPreferredSize(new Dimension(width, height));
with (width, height) being based upon the size of your screen.
__________________
WPILib dev (RobotBuilder, SmartDashboard, GRIP)

Last edited by Djur : 03-05-2012 at 22:48. Reason: line 119