summaryrefslogtreecommitdiff
path: root/ldmicro/draw_outputdev.cpp
diff options
context:
space:
mode:
authorRr422018-06-25 17:43:13 +0530
committerRr422018-06-25 17:43:13 +0530
commit81498daf0fa6f0004a322030acca6001f27a20e1 (patch)
treeb689544dcd140a7100d10fe5ced1bc50905a4e23 /ldmicro/draw_outputdev.cpp
parent8bad98abfaf76db07f77bc89366ab5572e724654 (diff)
downloadLDMicroGtk-81498daf0fa6f0004a322030acca6001f27a20e1.tar.gz
LDMicroGtk-81498daf0fa6f0004a322030acca6001f27a20e1.tar.bz2
LDMicroGtk-81498daf0fa6f0004a322030acca6001f27a20e1.zip
Added full timer functionality and partial simulation functionality.
Diffstat (limited to 'ldmicro/draw_outputdev.cpp')
-rw-r--r--ldmicro/draw_outputdev.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/ldmicro/draw_outputdev.cpp b/ldmicro/draw_outputdev.cpp
index 4979dbc..eab7324 100644
--- a/ldmicro/draw_outputdev.cpp
+++ b/ldmicro/draw_outputdev.cpp
@@ -81,9 +81,10 @@ SyntaxHighlightingColours HighlightColours;
// bottom, left, right) but we don't care; just go from the coordinates
// computed when we drew the schematic in the paint procedure.
//-----------------------------------------------------------------------------
-gboolean BlinkCursor(GtkWidget * window) //(HWND hwnd, UINT msg, UINT_PTR id, DWORD time)
+BOOL BlinkCursor(BOOL kill = FALSE)
{
// if(GetFocus(MainWindow) != !CursorDrawn) return TRUE;
+
if(Cursor.left == 0) return TRUE;
PlcCursor c;
@@ -129,7 +130,7 @@ gboolean BlinkCursor(GtkWidget * window) //(HWND hwnd, UINT msg, UINT_PTR id, DW
cairo_destroy(Hcr);
CursorDrawn = !CursorDrawn;
- return TRUE;
+ return !kill;
}
//-----------------------------------------------------------------------------
@@ -341,13 +342,11 @@ void PaintWindow(HCRDC Hcr)
// BitBlt(paintDc, 0, 0, bw, bh, BackDc, ScrollXOffset, 0, SRCCOPY);
- // if(InSimulationMode) {
- // KillTimer(MainWindow, TIMER_BLINK_CURSOR);
- // } else {
- // KillTimer(MainWindow, TIMER_BLINK_CURSOR);
- // BlinkCursor(NULL, 0, NULL, 0);
- // SetTimer(MainWindow, TIMER_BLINK_CURSOR, 800, BlinkCursor);
- // }
+ if(InSimulationMode) {
+ KillTimer(DrawWindow, TIMER_BLINK_CURSOR);
+ } else {
+ SetTimer(DrawWindow, TIMER_BLINK_CURSOR, 200, BlinkCursor);
+ }
ok();
}