Skip to content

Commit

Permalink
statusbar message for drawing mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias47n9e committed Jun 27, 2015
1 parent 5aad4dc commit d21d34c
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions innstereo/main_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,7 @@ def on_toolbutton_draw_features_toggled(self, widget):
self.draw_features = True
else:
self.draw_features = False
self.update_cursor_position(None)

def on_toolbutton_best_plane_clicked(self, widget):
# pylint: disable=unused-argument
Expand Down Expand Up @@ -2300,21 +2301,34 @@ def mpl_canvas_clicked(self, event):
def update_cursor_position(self, event):
"""
When the mouse cursor hovers inside the plot, the position of the
event is pushed to the statusbar at the bottom of the GUI.
event is pushed to the statusbar at the bottom of the GUI. Also
called by a few buttons, to push messages to the statusbar.
"""
if event.inaxes is not None:
alpha_deg, gamma_deg = self.convert_xy_to_dirdip(event)
def push_drawing_message():
self.statbar.push(1, "Left click inside the plot to draw a feature.")

if event is not None:
if event.inaxes is not None:
alpha_deg, gamma_deg = self.convert_xy_to_dirdip(event)

alpha_deg = int(alpha_deg)
gamma_deg = int(gamma_deg)
alpha_deg = int(alpha_deg)
gamma_deg = int(gamma_deg)

#Ensure 000/00 formatting
alpha_deg = str(alpha_deg).rjust(3, "0")
gamma_deg = str(gamma_deg).rjust(2, "0")
#Ensure 000/00 formatting
alpha_deg = str(alpha_deg).rjust(3, "0")
gamma_deg = str(gamma_deg).rjust(2, "0")

self.statbar.push(1, ("{0} / {1}".format(alpha_deg, gamma_deg)))
self.statbar.push(1, ("{0} / {1}".format(alpha_deg, gamma_deg)))
else:
if self.draw_features == True:
push_drawing_message()
else:
self.statbar.push(1, (""))
else:
self.statbar.push(1, (""))
if self.draw_features == True:
push_drawing_message()
else:
self.statbar.push(1, (""))

def on_toolbutton_file_parse_clicked(self, toolbutton):
"""
Expand Down

0 comments on commit d21d34c

Please sign in to comment.