diff options
author | akshay-c | 2019-04-11 16:57:56 +0530 |
---|---|---|
committer | akshay-c | 2019-04-11 16:57:56 +0530 |
commit | b0c1405589824fc9f9f464683286cdac7ad139d0 (patch) | |
tree | e28f1efce0fce74e20a95f42e965f02a372b29ee /ldmicro/maincontrols.cpp | |
parent | b874e82bc5a6856c4b2fa4c19f98ab2269daebc6 (diff) | |
download | LDmicroQt-b0c1405589824fc9f9f464683286cdac7ad139d0.tar.gz LDmicroQt-b0c1405589824fc9f9f464683286cdac7ad139d0.tar.bz2 LDmicroQt-b0c1405589824fc9f9f464683286cdac7ad139d0.zip |
Improved cursor performance, simulation timer, drawwindow,scrollbar,closeevent, open-save dialogs, submenu-disabling
Diffstat (limited to 'ldmicro/maincontrols.cpp')
-rw-r--r-- | ldmicro/maincontrols.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/ldmicro/maincontrols.cpp b/ldmicro/maincontrols.cpp index be15552..51d7b54 100644 --- a/ldmicro/maincontrols.cpp +++ b/ldmicro/maincontrols.cpp @@ -549,14 +549,20 @@ void MakeMainWindowControls(void) IoList->insertTopLevelItems(0, items);*/ DrawWindow->setAutoFillBackground(true); QSize DWSize; - + WM_SCROLL scrollbar = new QScrollArea(); + scrollbar->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); + scrollbar->setFocusPolicy(Qt::NoFocus); DWSize.setHeight(MainWindow->height() - IoListHeight); DWSize.setWidth(MainWindow->width()); DrawWindow->setMinimumHeight(100); - DrawWindow->resize(DWSize); - WM_SCROLL scrollbar = new QScrollArea(); + // scrollbar->setWidgetResizable(TRUE); + scrollbar->resize(DWSize); + // DrawWindow->resize(scrollbar->viewportSizeHint()); scrollbar->setWidget(DrawWindow); splitter->addWidget(scrollbar); + DWSize.setWidth(MainWindow->width() - + (scrollbar->sizeHint().width()+ MainWindow->sizeHint().width())); + DrawWindow->resize(DWSize); /*QPalette pal = QPalette(); pal.setColor(QPalette::Background, Qt::black); DrawWindow->setAutoFillBackground(true); @@ -958,6 +964,7 @@ void ToggleSimulationMode(void) { InSimulationMode = !InSimulationMode; if(InSimulationMode) { + KillTimer(DrawWindow, TIMER_BLINK_CURSOR); EnableMenuItem(SimulateMenu, StartSimulationMenu, MF_ENABLED); EnableMenuItem(SimulateMenu, SingleCycleMenu, MF_ENABLED); @@ -983,8 +990,8 @@ void ToggleSimulationMode(void) } else { RealTimeSimulationRunning = FALSE; - // KillTimer(MainWindow, TIMER_SIMULATE); - + KillTimer(DrawWindow, TIMER_SIMULATE); + CursorTimer = SetTimer(DrawWindow, TIMER_BLINK_CURSOR, 500, CursorTimer); EnableMenuItem(SimulateMenu, StartSimulationMenu, MF_GRAYED); EnableMenuItem(SimulateMenu, StopSimulationMenu, MF_GRAYED); EnableMenuItem(SimulateMenu, SingleCycleMenu, MF_GRAYED); @@ -1028,6 +1035,7 @@ void RefreshControlsToSettings(void) items.append(new QTreeWidgetItem(QStringList(QString("Item2")))); items.append(new QTreeWidgetItem(QStringList(QString("Item3")))); IoList->insertTopLevelItems(0, items);*/ + DrawWindow->repaint(); QTreeWidgetItem iter; QTreeWidgetItem* selection; if(!IoListOutOfSync) { @@ -1167,7 +1175,7 @@ void StopSimulation(void) EnableMenuItem(SimulateMenu, StartSimulationMenu, MF_ENABLED); EnableMenuItem(SimulateMenu, StopSimulationMenu, MF_GRAYED); - // KillTimer(MainWindow, TIMER_SIMULATE); + KillTimer(DrawWindow, TIMER_SIMULATE); // UpdateMainWindowTitleBar(); }
\ No newline at end of file |