summaryrefslogtreecommitdiff
path: root/lib/simulator/bitmap.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/simulator/bitmap.tcl')
-rw-r--r--[-rwxr-xr-x]lib/simulator/bitmap.tcl45
1 files changed, 27 insertions, 18 deletions
diff --git a/lib/simulator/bitmap.tcl b/lib/simulator/bitmap.tcl
index 6ed43e0..c2b4623 100755..100644
--- a/lib/simulator/bitmap.tcl
+++ b/lib/simulator/bitmap.tcl
@@ -2,7 +2,7 @@
# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net )
############################################################################
-# Copyright (C) 2007-2008 by Martin Ošmera #
+# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera #
# martin.osmera@gmail.com #
# #
# This program is free software; you can redistribute it and#or modify #
@@ -21,14 +21,19 @@
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #
############################################################################
+# >>> File inclusion guard
+if { ! [ info exists _BITMAP_TCL ] } {
+set _BITMAP_TCL _
+# <<< File inclusion guard
+
# --------------------------------------------------------------------------
# DESCRIPTION
-# Provides graphical view on bit addressable area in simulated MCU
+# Provides graphical view on bit addressable area in simulated MCU.
# --------------------------------------------------------------------------
class BitMap {
## COMMON
- common count 0 ;# Int: Counter of object instances
+ common btmap_count 0 ;# Int: Counter of object instances
# Last window geometry
common win_geometry [lindex $::CONFIG(BITMAP_CONFIG) 0]
@@ -52,15 +57,15 @@ class BitMap {
common one_a_outline #DDFFDD ;# Color: Bit outline color for log. 1 (Selected bit)
# Font: Normal font for canvas widget
- common bitmap_n_font [font create \
- -family $::DEFAULT_FIXED_FONT \
- -size -12 \
+ common bitmap_n_font [font create \
+ -family $::DEFAULT_FIXED_FONT \
+ -size [expr {int(-12 * $::font_size_factor)}] \
]
# Font: Bold font for canvas widget
- common bitmap_b_font [font create \
- -family $::DEFAULT_FIXED_FONT \
- -size -12 \
- -weight bold \
+ common bitmap_b_font [font create \
+ -family $::DEFAULT_FIXED_FONT \
+ -size [expr {int(-12 * $::font_size_factor)}] \
+ -weight bold \
]
@@ -117,8 +122,8 @@ class BitMap {
}
# Create dialog window
- set win [toplevel .bitmap_$count -class {Bitmap} -bg {#EEEEEE}]
- incr count
+ set win [toplevel .bitmap_${btmap_count} -class {Bitmap} -bg ${::COMMON_BG_COLOR}]
+ incr btmap_count
# ----------------------------------------------------------------
# Create main frame and canvas widget
@@ -340,7 +345,7 @@ class BitMap {
# Set window parameters
wm protocol $win WM_DELETE_WINDOW "$this bitmap_close_dialog"
wm resizable $win 0 0
- wm title $win [mc "Bit addressable area - %s - %s" [string trim $this {:}] "MCU 8051 IDE"]
+ wm title $win [mc "Bit addressable area - %s - %s - %s" [$this cget -P_option_mcu_type] [$this cget -projectName] "MCU 8051 IDE"]
wm iconphoto $win ::ICONS::16::kcmmemory_BA
catch {
wm geometry $win $win_geometry
@@ -365,14 +370,14 @@ class BitMap {
if {$bits_states($addr)} {
set outline $one_a_outline
set fill $one_a_fill
- } {
+ } else {
set outline $zero_a_outline
set fill $zero_a_fill
}
# Set new rectangle colors and changle cursor
if {$enabled} {
$bitmap_canvas itemconfigure $bits($addr) -outline $outline -fill $fill
- $bitmap_canvas configure -cursor hand1
+ $bitmap_canvas configure -cursor hand2
}
## Adjust address meters
@@ -400,7 +405,7 @@ class BitMap {
if {$bits_states($addr)} {
set outline $one_outline
set fill $one_fill
- } {
+ } else {
set outline $zero_outline
set fill $zero_fill
}
@@ -479,7 +484,7 @@ class BitMap {
if {$original_val != $bits_states($bit_addr)} {
if {$bits_states($bit_addr)} {
set fill $one_fill
- } {
+ } else {
set fill $zero_fill
}
@@ -500,7 +505,7 @@ class BitMap {
for {set i 0} {$i < 128} {incr i} {
if {$bits_states($i)} {
set outline $one_outline
- } {
+ } else {
set outline $zero_outline
}
$bitmap_canvas itemconfigure $bits($i) -outline $outline
@@ -508,3 +513,7 @@ class BitMap {
}
}
+
+# >>> File inclusion guard
+}
+# <<< File inclusion guard