Commit 7a10d6138a322c33039db6a6a2f87063249b6a83

Authored by Paulo Henrique Junqueira Amorim
1 parent e223d60e

ENH: Dialog of image reduction

Showing 1 changed file with 13 additions and 16 deletions   Show diff stats
invesalius/gui/dialogs.py
... ... @@ -92,46 +92,43 @@ class ResizeImageDialog(wx.Dialog):
92 92 style=wx.DEFAULT_DIALOG_STYLE)
93 93 self.PostCreate(pre)
94 94  
95   - lbl_message = wx.StaticText(self, -1, _("Your operational system is 32bits or have \nlow memory. It's recommended to reduce the image resolution."))
96   -
  95 + lbl_message = wx.StaticText(self, -1, _("Your operational system is 32bits or have low memory. \nIf you manipulate 3D surface or volume rendering \nit's recommended to reduce the image resolution."))
97 96 icon = wx.ArtProvider.GetBitmap(wx.ART_WARNING, wx.ART_MESSAGE_BOX, (32,32))
98 97 bmp = wx.StaticBitmap(self, -1, icon)
99 98  
100 99 btn_ok = wx.Button(self, wx.ID_OK)
101   - btn_ok.SetHelpText("Value will be applied.")
102 100 btn_ok.SetDefault()
103 101  
104 102 btn_cancel = wx.Button(self, wx.ID_CANCEL)
105   - btn_cancel.SetHelpText("Value will not be applied.")
106 103  
107 104 btn_sizer = wx.StdDialogButtonSizer()
108 105 btn_sizer.AddButton(btn_ok)
109 106 btn_sizer.AddButton(btn_cancel)
110 107 btn_sizer.Realize()
111 108  
112   - lbl_message_percent = wx.StaticText(self, -1, _("Resolution percentage"))
  109 + lbl_message_percent = wx.StaticText(self, -1,_("Resolution percentage of image"))
113 110  
114   - num_ctrl_percent = wx.SpinCtrl(self, -1, "", (30, 50))
115   - num_ctrl_percent.SetRange(20,100)
  111 + num_ctrl_percent = wx.SpinCtrl(self, -1)
  112 + num_ctrl_percent.SetRange(20,100)
116 113 self.num_ctrl_porcent = num_ctrl_percent
117 114  
118 115 sizer_percent = wx.BoxSizer(wx.HORIZONTAL)
119   - sizer_percent.Add(lbl_message_percent, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
120   - sizer_percent.Add(num_ctrl_percent, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
  116 + sizer_percent.Add(lbl_message_percent, 0, wx.EXPAND|wx.ALL, 5)
  117 + sizer_percent.Add(num_ctrl_percent, 0, wx.ALL, 5)
121 118  
122 119 sizer_itens = wx.BoxSizer(wx.VERTICAL)
123   - sizer_itens.Add(lbl_message, 0, wx.ALIGN_CENTRE_VERTICAL|wx.ALL|wx.EXPAND, 5)
124   - sizer_itens.AddSizer(sizer_percent, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
125   - sizer_itens.Add(btn_sizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 25)
  120 + sizer_itens.Add(lbl_message, 0, wx.EXPAND|wx.ALL, 5)
  121 + sizer_itens.AddSizer(sizer_percent, 0, wx.EXPAND|wx.ALL, 5)
  122 + sizer_itens.Add(btn_sizer, 0, wx.EXPAND|wx.ALL, 5)
126 123  
127 124 sizer_general = wx.BoxSizer(wx.HORIZONTAL)
128   - sizer_general.Add(bmp, 0, wx.ALIGN_CENTRE|wx.ALL, 15)
129   - sizer_general.AddSizer(sizer_itens, 90, wx.ALIGN_CENTRE|wx.ALL, 10)
  125 + sizer_general.Add(bmp, 0, wx.ALIGN_CENTRE|wx.ALL, 10)
  126 + sizer_general.AddSizer(sizer_itens, 0, wx.ALL , 5)
130 127  
  128 + #self.SetAutoLayout(True)
131 129 self.SetSizer(sizer_general)
132   - sizer_itens.Fit(self)
  130 + sizer_general.Fit(self)
133 131 self.Layout()
134   - self.SetAutoLayout(True)
135 132 self.Centre()
136 133  
137 134 def SetValue(self, value):
... ...