Changeset 17 in tspsg-svn for trunk/src/mainwindow.cpp


Ignore:
Timestamp:
Jun 15, 2009, 5:10:25 PM (15 years ago)
Author:
laleppa
Message:

+ Windows CE (WM6, actually, but should work on other versions) support:

  • added optimized for wince forms (recommended minimal resolution is 240x320);
  • removed unsupported under wince features from menus (e.g., printing);
  • added preprocessor directives to remove code for unsupported under wince features.
  • Fixed wrong encoding in some files to UTF-8.
  • Updated copyright and e-mail.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1 *.vcproj*
         1*.idb
        22*.ncb
         3*.pdb
        34*.sln
        45*.suo
        5 *.idb
        6 *.pdb
        7 ui_*
         6*.vcproj*
         7Makefile*
         8Win32
         9Windows Mobile*
         10debug
        811moc_*
        912qrc_*
        10 tspsg
        11 Makefile*
        12 debug
        1313release
         14ui_*
  • trunk/src/mainwindow.cpp

    r15 r17  
    11/*
    22 *  TSPSG - TSP Solver and Generator
    3  *  Copyright (C) 2007 Lёppa <lacontacts[at]gmail[dot]com>
     3 *  Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
    44 *
    55 *  $Id$
     
    2323
    2424#include <QtGui>
     25#ifndef Q_OS_WINCE
     26        #include <QPrintDialog>
     27#endif // Q_OS_WINCE
    2528#include "mainwindow.h"
    2629
     
    3235        setupUi(this);
    3336        connect(actionSettingsSettings,SIGNAL(triggered()),this,SLOT(ChangeSettings()));
     37#ifndef Q_OS_WINCE
     38        connect(actionFilePrintSetup,SIGNAL(triggered()),this,SLOT(PrintSetup()));
     39#endif // Q_OS_WINCE
    3440        connect(buttonSolve,SIGNAL(clicked()),this,SLOT(Solve()));
    3541        connect(buttonRandom,SIGNAL(clicked()),this,SLOT(Random()));
    3642        connect(spinCities,SIGNAL(valueChanged(int)),this,SLOT(CitiesNumberChanged(int)));
     43QRect rect = geometry();
     44#ifdef Q_OS_WINCE
     45        // HACK: Fix for all tabWidget elements becoming "unclickable" if making it central widget.
     46        rect.setSize(QApplication::desktop()->availableGeometry().size());
     47        rect.setHeight(rect.height() - (QApplication::desktop()->screenGeometry().height() - QApplication::desktop()->availableGeometry().height()));
     48        tabWidget->resize(rect.width(),rect.height() - toolBar->size().height());
     49#else
    3750        // Centering MainWindow
    3851        // TODO: Loading of saved window state
    39 QRect rect = geometry();
    40         rect.moveCenter(QApplication::desktop()->screenGeometry(QApplication::desktop()->primaryScreen()).center());
     52        rect.moveCenter(QApplication::desktop()->availableGeometry().center());
     53#endif // Q_OS_WINCE
    4154        setGeometry(rect);
    4255        qsrand(QDateTime().currentDateTime().toTime_t());
     
    6376        }
    6477}
     78
     79#ifndef Q_OS_WINCE
     80void MainWindow::PrintSetup()
     81{
     82QPrintDialog pd;
     83        pd.exec();
     84}
     85#endif // Q_OS_WINCE
    6586
    6687void MainWindow::Random()
     
    93114        // tabWidget->setCurrentIndex(1);
    94115}
    95 
Note: See TracChangeset for help on using the changeset viewer.