From 81498daf0fa6f0004a322030acca6001f27a20e1 Mon Sep 17 00:00:00 2001 From: Rr42 Date: Mon, 25 Jun 2018 17:43:13 +0530 Subject: Added full timer functionality and partial simulation functionality. --- ldmicro/draw_outputdev.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'ldmicro/draw_outputdev.cpp') 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(); } -- cgit