summaryrefslogtreecommitdiff
path: root/ldmicro/ldmicro.cpp
diff options
context:
space:
mode:
authorRr422018-06-20 11:57:42 +0530
committerRr422018-06-20 11:57:42 +0530
commite4c4f5ea11291e551967f5240f53c43895771ffb (patch)
tree844383f076ce64b4bb207fc4216f572dd9aaace3 /ldmicro/ldmicro.cpp
parent940b1617d158f24abfbc5c5f6e541ae6136b4347 (diff)
downloadLDMicroGtk-e4c4f5ea11291e551967f5240f53c43895771ffb.tar.gz
LDMicroGtk-e4c4f5ea11291e551967f5240f53c43895771ffb.tar.bz2
LDMicroGtk-e4c4f5ea11291e551967f5240f53c43895771ffb.zip
Major update with functional program display (without cursor)
Diffstat (limited to 'ldmicro/ldmicro.cpp')
-rw-r--r--ldmicro/ldmicro.cpp43
1 files changed, 30 insertions, 13 deletions
diff --git a/ldmicro/ldmicro.cpp b/ldmicro/ldmicro.cpp
index 9a5c9a3..1fa8567 100644
--- a/ldmicro/ldmicro.cpp
+++ b/ldmicro/ldmicro.cpp
@@ -1000,23 +1000,31 @@ gboolean LD_GTK_mouse_scroll_hook(GtkWidget *widget, GdkEvent *event, gpointer u
* WM_VSCROLL, WM_HSCROLL, WM_MOUSEWHEEL
*/
+ MainWindowResized();
+ PaintWindow();
+
switch(event->scroll.direction)
{
case GDK_SCROLL_UP:
+ VscrollProc(SB_LINEUP);
+ break;
case GDK_SCROLL_DOWN:
- // VscrollProc(wParam);
+ VscrollProc(SB_LINEDOWN);
break;
case GDK_SCROLL_LEFT:
+ HscrollProc(SB_LINEUP);
+ break;
case GDK_SCROLL_RIGHT:
- // HscrollProc(wParam);
+ HscrollProc(SB_LINEDOWN);
break;
case GDK_SCROLL_SMOOTH:
- // if((GET_WHEEL_DELTA_WPARAM(wParam)) > 0) {
- // VscrollProc(SB_LINEUP);
- // } else {
- // VscrollProc(SB_LINEDOWN);
- // }
- // gdk_event_get_scroll_deltas (const GdkEvent *event, gdouble *delta_x, gdouble *delta_y);
+ double d_x, d_y;
+ gdk_event_get_scroll_deltas (event, &d_x, &d_y);
+ if(d_y > 0) {
+ VscrollProc(SB_LINEUP);
+ } else {
+ VscrollProc(SB_LINEDOWN);
+ }
break;
}
@@ -1051,7 +1059,7 @@ gboolean LD_WM_Paint_call(HWID widget, HCRDC cr, gpointer data)
* WM_PAINT
*/
- g_print("draw called\n");
+ // g_print("draw called----------------------------------\n");
// guint width, height;
// GdkRGBA color;
@@ -1061,10 +1069,10 @@ gboolean LD_WM_Paint_call(HWID widget, HCRDC cr, gpointer data)
// width = gtk_widget_get_allocated_width (widget);
// height = gtk_widget_get_allocated_height (widget);
- // // g_print("w = %i\n", width);
- // // g_print("h = %i\n", height);
+ // g_print("w = %i\n", width);
+ // g_print("h = %i\n", height);
- // // SetBkColor(widget, cr, HighlightColours.bg);
+ // SetBkColor(widget, cr, HighlightColours.bg);
// gtk_render_background (context, cr, 0, 0, width, height);
@@ -1083,8 +1091,17 @@ gboolean LD_WM_Paint_call(HWID widget, HCRDC cr, gpointer data)
// cairo_fill (cr);
- Hdc = cr;
+ // SetBkColor(DrawWindow, cr, InSimulationMode ? HighlightColours.simBg :
+ // HighlightColours.bg);
+ // SetTextColor(cr, InSimulationMode ? HighlightColours.simRungNum :
+ // HighlightColours.rungNum);
+ // SelectObject(cr, FixedWidthFont);
+ // for (int xp = 0; xp<= width; xp += 7)
+ // for (int yp = 0; yp <= height; yp += 7)
+ // TextOut(DrawWindow, cr, xp, yp, "H", 1);
+ Hdc = cr;
+
/// This draws the schematic.
PaintWindow();