本文整理汇总了Python中ginga.qtw.QtHelp.build_info方法的典型用法代码示例。如果您正苦于以下问题:Python QtHelp.build_info方法的具体用法?Python QtHelp.build_info怎么用?Python QtHelp.build_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ginga.qtw.QtHelp
的用法示例。
在下文中一共展示了QtHelp.build_info方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_info_window
# 需要导入模块: from ginga.qtw import QtHelp [as 别名]
# 或者: from ginga.qtw.QtHelp import build_info [as 别名]
def create_info_window(self):
sw = QtGui.QScrollArea()
widget = QtGui.QWidget()
vbox = QtGui.QVBoxLayout()
vbox.setContentsMargins(2, 2, 2, 2)
widget.setLayout(vbox)
captions = (
('X', 'xlabel', '@X', 'entry'),
('Y', 'xlabel', '@Y', 'entry'),
('Z', 'xlabel', '@Z', 'entry'),
('Radius','label'),('Theta','label'),('Phi','label'),
('RA', 'label'), ('DEC', 'label'),
('Radius2','label'),('Theta2','label'),('Phi2','label'),
)
w, b = QtHelp.build_info(captions)
b.x.setToolTip("Set X value (press Enter)")
b.y.setToolTip("Set Y value (press Enter)")
b.z.setToolTip('Set Z value (press Enter)')
vbox.addWidget(w, stretch=0)
#widget.show()
sw.setWidget(widget)
return sw, b
示例2: gui_add_channels
# 需要导入模块: from ginga.qtw import QtHelp [as 别名]
# 或者: from ginga.qtw.QtHelp import build_info [as 别名]
def gui_add_channels(self):
captions = (('Prefix', 'entry'),
('Number', 'spinbutton'),
('Workspace', 'combobox'),
)
w, b = QtHelp.build_info(captions)
b.prefix.setText("Image")
b.number.setRange(1, 12)
b.number.setSingleStep(1)
b.number.setValue(1)
cbox = b.workspace
names = self.ds.get_wsnames()
try:
idx = names.index('channels')
except:
idx = 0
for name in names:
cbox.append_text(name)
cbox.setCurrentIndex(idx)
dialog = QtHelp.Dialog("Add Channels",
0,
[['Cancel', 0], ['Ok', 1]],
lambda w, rsp: self.add_channels_cb(w, rsp,
b, names))
box = dialog.get_content_area()
layout = QtGui.QVBoxLayout()
box.setLayout(layout)
layout.addWidget(w, stretch=1)
dialog.show()
示例3: build_gui
# 需要导入模块: from ginga.qtw import QtHelp [as 别名]
# 或者: from ginga.qtw.QtHelp import build_info [as 别名]
def build_gui(self, container):
sw = QtGui.QScrollArea()
twidget = QtHelp.VBox()
sp = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding,
QtGui.QSizePolicy.Fixed)
twidget.setSizePolicy(sp)
vbox1 = twidget.layout()
vbox1.setContentsMargins(4, 4, 4, 4)
vbox1.setSpacing(2)
sw.setWidgetResizable(True)
sw.setWidget(twidget)
msgFont = QtGui.QFont("Sans", 14)
tw = QtGui.QLabel()
tw.setFont(msgFont)
tw.setWordWrap(True)
self.tw = tw
fr = QtHelp.Frame("Instructions")
fr.layout().addWidget(tw, stretch=1, alignment=QtCore.Qt.AlignTop)
vbox1.addWidget(fr, stretch=0, alignment=QtCore.Qt.AlignTop)
fr = QtHelp.Frame("HDU")
captions = [("Num HDUs", 'label'), ("Choose HDU", 'spinbutton')]
w, b = QtHelp.build_info(captions)
self.w.update(b)
self.w.numhdu = b.num_hdus
self.w.hdu = b.choose_hdu
self.w.hdu.valueChanged.connect(self.set_hdu_cb)
fr.layout().addWidget(w, stretch=1, alignment=QtCore.Qt.AlignLeft)
vbox1.addWidget(fr, stretch=0, alignment=QtCore.Qt.AlignTop)
fr = QtHelp.Frame("NAXIS")
self.stack = QtHelp.StackedWidget()
self.stack.addWidget(QtGui.QLabel(''))
fr.layout().addWidget(self.stack, stretch=1, alignment=QtCore.Qt.AlignLeft)
vbox1.addWidget(fr, stretch=0, alignment=QtCore.Qt.AlignTop)
btns = QtHelp.HBox()
layout = btns.layout()
layout.setSpacing(3)
#btns.set_child_size(15, -1)
btn = QtGui.QPushButton("Close")
btn.clicked.connect(self.close)
layout.addWidget(btn, stretch=0, alignment=QtCore.Qt.AlignLeft)
vbox1.addWidget(btns, stretch=0, alignment=QtCore.Qt.AlignLeft)
container.addWidget(sw, stretch=1)
示例4: build_gui
# 需要导入模块: from ginga.qtw import QtHelp [as 别名]
# 或者: from ginga.qtw.QtHelp import build_info [as 别名]
def build_gui(self, container):
sw = QtGui.QScrollArea()
twidget = QtHelp.VBox()
sp = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding,
QtGui.QSizePolicy.Fixed)
twidget.setSizePolicy(sp)
vbox1 = twidget.layout()
vbox1.setContentsMargins(4, 4, 4, 4)
vbox1.setSpacing(2)
sw.setWidgetResizable(True)
sw.setWidget(twidget)
msgFont = QtGui.QFont("Sans", 14)
tw = QtGui.QLabel()
tw.setFont(msgFont)
tw.setWordWrap(True)
self.tw = tw
fr = QtHelp.Frame("Instructions")
fr.layout().addWidget(tw, stretch=1, alignment=QtCore.Qt.AlignTop)
vbox1.addWidget(fr, stretch=0, alignment=QtCore.Qt.AlignTop)
fr = QtHelp.Frame("Ruler")
captions = (('Units', 'combobox'),)
w, b = QtHelp.build_info(captions)
self.w = b
combobox = b.units
for name in self.unittypes:
combobox.addItem(name)
index = self.unittypes.index(self.units)
combobox.setCurrentIndex(index)
combobox.activated.connect(self.set_units)
fr.layout().addWidget(w, stretch=1, alignment=QtCore.Qt.AlignLeft)
vbox1.addWidget(fr, stretch=0, alignment=QtCore.Qt.AlignTop)
btns = QtHelp.HBox()
layout = btns.layout()
layout.setSpacing(3)
#btns.set_child_size(15, -1)
btn = QtGui.QPushButton("Close")
btn.clicked.connect(self.close)
layout.addWidget(btn, stretch=0, alignment=QtCore.Qt.AlignLeft)
vbox1.addWidget(btns, stretch=0, alignment=QtCore.Qt.AlignLeft)
container.addWidget(sw, stretch=1)
示例5: gui_add_ws
# 需要导入模块: from ginga.qtw import QtHelp [as 别名]
# 或者: from ginga.qtw.QtHelp import build_info [as 别名]
def gui_add_ws(self):
captions = (('Workspace name', 'entry'),
('Workspace type', 'combobox'),
('In workspace', 'combobox'),
('Channel prefix', 'entry'),
('Number of channels', 'spinbutton'),
('Share settings', 'entry'),
)
w, b = QtHelp.build_info(captions)
wsname = "ws%d" % (self.wscount)
self.wscount += 1
b.workspace_name.setText(wsname)
b.share_settings.setMaxLength(60)
cbox = b.workspace_type
cbox.append_text("Tabs")
cbox.append_text("Grid")
cbox.append_text("MDI")
cbox.setCurrentIndex(1)
cbox = b.in_workspace
names = self.ds.get_wsnames()
names.insert(0, 'top level')
try:
idx = names.index('channels')
except:
idx = 0
for name in names:
cbox.append_text(name)
cbox.setCurrentIndex(idx)
b.channel_prefix.setText("Image")
spnbtn = b.number_of_channels
spnbtn.setRange(0, 12)
spnbtn.setSingleStep(1)
spnbtn.setValue(4)
dialog = QtHelp.Dialog("Add Workspace",
0,
[['Cancel', 0], ['Ok', 1]],
lambda w, rsp: self.new_ws_cb(w, rsp, b, names))
box = dialog.get_content_area()
layout = QtGui.QVBoxLayout()
box.setLayout(layout)
layout.addWidget(w, stretch=1)
dialog.show()
self._cur_dialogs.append(dialog)
示例6: build_gui
# 需要导入模块: from ginga.qtw import QtHelp [as 别名]
# 或者: from ginga.qtw.QtHelp import build_info [as 别名]
def build_gui(self, container):
width, height = 300, 300
cm, im = self.fv.cm, self.fv.im
tg = ImageViewCanvasQt.ImageViewCanvas(logger=self.logger)
tg.configure_window(200, 200)
tg.enable_autozoom('on')
tg.set_autocut_params('zscale')
tg.enable_autocuts('override')
tg.enable_auto_orient(True)
tg.defer_redraw = False
tg.set_bg(0.7, 0.7, 0.7)
self.thumb_generator = tg
sw = MyScrollArea()
sw.setWidgetResizable(True)
#sw.setEnabled(True)
sw.thumbs_cb = self.thumbpane_resized_cb
# Create thumbnails pane
widget = QtGui.QWidget()
vbox = QtGui.QGridLayout()
vbox.setContentsMargins(4, 4, 4, 4)
vbox.setSpacing(14)
widget.setLayout(vbox)
self.w.thumbs = vbox
self.w.thumbs_w = widget
#widget.show()
sw.setWidget(widget)
self.w.thumbs_scroll = sw
#self.w.thumbs_scroll.connect("size_allocate", self.thumbpane_resized_cb)
# TODO: should this even have it's own scrolled window?
cw = container.get_widget()
cw.addWidget(sw, stretch=1)
sw.show()
captions = (('Auto scroll', 'checkbutton', 'Clear', 'button'),)
w, b = QtHelp.build_info(captions)
self.w.update(b)
b.auto_scroll.setToolTip("Scroll the thumbs window when new images arrive")
b.clear.setToolTip("Remove all current thumbnails")
b.clear.clicked.connect(self.clear)
auto_scroll = self.settings.get('auto_scroll', True)
b.auto_scroll.setChecked(auto_scroll)
cw.addWidget(w, stretch=0)
self.gui_up = True
示例7: build_gui
# 需要导入模块: from ginga.qtw import QtHelp [as 别名]
# 或者: from ginga.qtw.QtHelp import build_info [as 别名]
def build_gui(self, container):
canvas = CanvasTypes.DrawingCanvas()
canvas.enable_draw(False)
#canvas.set_callback('button-press', self.btndown)
canvas.set_callback('motion', self.cursormotion)
#canvas.set_callback('button-release', self.update)
canvas.add_callback('key-press', self.window_key_press)
canvas.add_callback('key-release', self.window_key_release)
self.canvas = canvas
vbox = QtHelp.VBox()
sp = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding,
QtGui.QSizePolicy.Fixed)
vbox.setSizePolicy(sp)
fr = QtHelp.Frame("IRAF")
captions = [("Control", 'hbox'),
("Channel", 'label'),
]
w, b = QtHelp.build_info(captions)
self.w = b
self.w.mode_d = {}
btn = QtGui.QRadioButton("Ginga")
btn.toggled.connect(lambda w: self.switchMode('ginga'))
self.w.mode_d['ginga'] = btn
self.w.control.layout().addWidget(btn, stretch=0,
alignment=QtCore.Qt.AlignLeft)
btn = QtGui.QRadioButton("IRAF")
btn.toggled.connect(lambda w: self.switchMode('iraf'))
self.w.mode_d['iraf'] = btn
self.w.control.layout().addWidget(btn, stretch=0,
alignment=QtCore.Qt.AlignLeft)
fr.layout().addWidget(w, stretch=1, alignment=QtCore.Qt.AlignLeft)
vbox.addWidget(fr, stretch=0, alignment=QtCore.Qt.AlignTop)
fr = QtHelp.Frame("Frame/Channel")
lbl = QtGui.QLabel("")
self.w.frch = lbl
fr.layout().addWidget(lbl, stretch=1, alignment=QtCore.Qt.AlignLeft)
vbox.addWidget(fr, stretch=0, alignment=QtCore.Qt.AlignTop)
container.addWidget(vbox, stretch=0, alignment=QtCore.Qt.AlignTop)
示例8: build_gui
# 需要导入模块: from ginga.qtw import QtHelp [as 别名]
# 或者: from ginga.qtw.QtHelp import build_info [as 别名]
def build_gui(self, container):
rvbox = container
width, height = 300, 300
cm, im = self.fv.cm, self.fv.im
tg = FitsImageQt.FitsImageQt(logger=self.logger)
tg.configure(200, 200)
tg.enable_autozoom('on')
tg.enable_autocuts('on')
tg.enable_auto_orient(True)
tg.set_makebg(False)
self.thumb_generator = tg
sw = MyScrollArea()
sw.setWidgetResizable(True)
#sw.setEnabled(True)
sw.thumbs_cb = self.thumbpane_resized_cb
# Create thumbnails pane
widget = QtGui.QWidget()
vbox = QtGui.QGridLayout()
vbox.setContentsMargins(4, 4, 4, 4)
vbox.setSpacing(14)
widget.setLayout(vbox)
self.w.thumbs = vbox
self.w.thumbs_w = widget
#widget.show()
sw.setWidget(widget)
self.w.thumbs_scroll = sw
#self.w.thumbs_scroll.connect("size_allocate", self.thumbpane_resized_cb)
# TODO: should this even have it's own scrolled window?
rvbox.addWidget(sw, stretch=1)
sw.show()
captions = (('Auto scroll', 'checkbutton'),)
w, b = QtHelp.build_info(captions)
self.w.update(b)
b.auto_scroll.setToolTip("Scroll the thumbs window when new images arrive")
autoScroll = self.settings.get('autoScroll', True)
b.auto_scroll.setChecked(autoScroll)
rvbox.addWidget(w, stretch=0)
示例9: build_naxis
# 需要导入模块: from ginga.qtw import QtHelp [as 别名]
# 或者: from ginga.qtw.QtHelp import build_info [as 别名]
def build_naxis(self, dims):
# build a vbox of NAXIS controls
captions = [("NAXIS1", "label"), ("NAXIS2", "label")]
self.naxispath = []
for n in xrange(2, len(dims)):
self.naxispath.append(0)
key = "naxis%d" % (n + 1)
title = key.upper()
maxn = int(dims[n])
self.logger.debug("NAXIS%d=%d" % (n + 1, maxn))
if maxn <= 1:
captions.append((title, "label"))
else:
captions.append((title, "label", "Choose %s" % (title), "spinbutton"))
w, b = QtHelp.build_info(captions)
for n in xrange(0, len(dims)):
key = "naxis%d" % (n + 1)
lbl = b[key]
maxn = int(dims[n])
lbl.setText("%d" % maxn)
slkey = "choose_" + key
if b.has_key(slkey):
slider = b[slkey]
lower = 1
upper = maxn
slider.setRange(lower, upper)
slider.setSingleStep(1)
slider.setWrapping(True)
def make_cbfn(n):
return lambda idx: self.set_naxis_cb(idx - 1, n)
slider.valueChanged.connect(make_cbfn(n))
# Add naxis controls to gui
try:
oldw = self.stack.currentWidget()
self.stack.removeWidget(oldw)
except:
pass
self.stack.addWidget(w)
示例10: _setup_params
# 需要导入模块: from ginga.qtw import QtHelp [as 别名]
# 或者: from ginga.qtw.QtHelp import build_info [as 别名]
def _setup_params(self, obj, container):
params = obj.getParams()
captions = []
for key, bnch in params.items():
text = key
if bnch.has_key('label'):
text = bnch.label
captions.append((text, 'entry'))
# TODO: put RA/DEC first, and other stuff not in random orders
w, b = QtHelp.build_info(captions)
# remove old widgets
old_w = container.currentWidget()
if old_w != None:
container.removeWidget(old_w)
# add new widgets
container.insertWidget(0, w)
return b
示例11: build_gui
# 需要导入模块: from ginga.qtw import QtHelp [as 别名]
# 或者: from ginga.qtw.QtHelp import build_info [as 别名]
def build_gui(self, container):
# self.msgFont = self.fv.getFont("fixedFont", 10)
tw = QtGui.QPlainTextEdit()
tw.setReadOnly(True)
# tw.setCurrentFont(self.msgFont)
tw.setLineWrapMode(QtGui.QPlainTextEdit.NoWrap)
tw.setMaximumBlockCount(self.histlimit)
self.tw = tw
sw = QtGui.QScrollArea()
sw.setWidgetResizable(True)
sw.setWidget(self.tw)
container.addWidget(sw, stretch=1)
# sw.show()
captions = (("Level", "combobox", "History", "spinbutton"), ("Auto scroll", "checkbutton", "Clear", "button"))
w, b = QtHelp.build_info(captions)
self.w.update(b)
combobox = b.level
for (name, level) in self.levels:
combobox.addItem(name)
combobox.setCurrentIndex(1)
combobox.activated.connect(self.set_loglevel_cb)
combobox.setToolTip("Set the logging level")
spinbox = b.history
spinbox.setRange(100, self.histmax)
spinbox.setSingleStep(10)
spinbox.setValue(self.histlimit)
spinbox.valueChanged.connect(self.set_history_cb)
spinbox.setToolTip("Set the logging history line limit")
btn = b.auto_scroll
btn.setToolTip("Scroll the log window automatically")
btn = b.clear
btn.clicked.connect(self.clear)
btn.setToolTip("Clear the log history")
container.addWidget(w, stretch=0)
示例12: _setup_params
# 需要导入模块: from ginga.qtw import QtHelp [as 别名]
# 或者: from ginga.qtw.QtHelp import build_info [as 别名]
def _setup_params(self, obj, container):
params = obj.getParams()
captions = []
paramList = sorted(params.values(), key=lambda b: b.order)
for bnch in paramList:
text = bnch.name
if 'label' in bnch:
text = bnch.label
#captions.append((text, 'entry'))
captions.append((text, 'xlabel', '@'+bnch.name, 'entry'))
# TODO: put RA/DEC first, and other stuff not in random orders
w, b = QtHelp.build_info(captions)
# remove old widgets
old_w = container.currentWidget()
if old_w != None:
container.removeWidget(old_w)
# add new widgets
container.insertWidget(0, w)
return b
示例13: build_gui
# 需要导入模块: from ginga.qtw import QtHelp [as 别名]
# 或者: from ginga.qtw.QtHelp import build_info [as 别名]
def build_gui(self, container, future=None):
vbox1 = QtHelp.VBox()
msgFont = self.fv.getFont("sansFont", 14)
tw = QtGui.QLabel()
tw.setFont(msgFont)
tw.setWordWrap(True)
self.tw = tw
fr = QtHelp.Frame("Instructions")
fr.addWidget(tw, stretch=1, alignment=QtCore.Qt.AlignTop)
vbox1.addWidget(fr, stretch=0, alignment=QtCore.Qt.AlignTop)
nb = QtHelp.TabWidget()
nb.setTabPosition(QtGui.QTabWidget.South)
nb.setUsesScrollButtons(True)
self.w.nb = nb
#vbox1.addWidget(nb, stretch=1, alignment=QtCore.Qt.AlignTop)
vbox1.addWidget(nb, stretch=1)
vbox0 = QtHelp.VBox()
hbox = QtHelp.HBox()
hbox.setSpacing(4)
vbox0.addWidget(hbox, stretch=1, alignment=QtCore.Qt.AlignTop)
vbox = QtHelp.VBox()
fr = QtHelp.Frame(" Image Server ")
fr.addWidget(vbox, stretch=1, alignment=QtCore.Qt.AlignTop)
hbox.addWidget(fr, stretch=0, alignment=QtCore.Qt.AlignLeft)
captions = (('Server', 'xlabel'),
('@Server', 'combobox'),
('Use DSS channel', 'checkbutton'),
('Get Image', 'button'))
w, b = QtHelp.build_info(captions)
self.w.update(b)
self.w.get_image.clicked.connect(self.getimage_cb)
self.w.use_dss_channel.setChecked(self.use_dss_channel)
self.w.use_dss_channel.stateChanged.connect(self.use_dss_channel_cb)
vbox.addWidget(w, stretch=0, alignment=QtCore.Qt.AlignTop)
self.w.img_params = QtHelp.StackedWidget()
vbox.addWidget(self.w.img_params, stretch=1,
alignment=QtCore.Qt.AlignTop)
combobox = self.w.server
index = 0
self.image_server_options = self.fv.imgsrv.getServerNames(kind='image')
for name in self.image_server_options:
combobox.addItem(name)
index += 1
index = 0
combobox.setCurrentIndex(index)
combobox.activated.connect(self.setup_params_image)
if len(self.image_server_options) > 0:
self.setup_params_image(index, redo=False)
vbox = QtHelp.VBox()
fr = QtHelp.Frame(" Catalog Server ")
fr.addWidget(vbox, stretch=1, alignment=QtCore.Qt.AlignTop)
hbox.addWidget(fr, stretch=0, alignment=QtCore.Qt.AlignLeft)
captions = (('Server', 'xlabel'),
('@Server', 'combobox'),
('Limit stars to area', 'checkbutton'),
('Search', 'button'))
w, self.w2 = QtHelp.build_info(captions)
self.w2.search.clicked.connect(self.getcatalog_cb)
self.w2.limit_stars_to_area.setChecked(self.limit_stars_to_area)
self.w2.limit_stars_to_area.stateChanged.connect(self.limit_area_cb)
vbox.addWidget(w, stretch=0, alignment=QtCore.Qt.AlignTop)
self.w2.cat_params = QtHelp.StackedWidget()
vbox.addWidget(self.w2.cat_params, stretch=1,
alignment=QtCore.Qt.AlignTop)
combobox = self.w2.server
index = 0
self.catalog_server_options = self.fv.imgsrv.getServerNames(kind='catalog')
for name in self.catalog_server_options:
combobox.addItem(name)
index += 1
index = 0
combobox.setCurrentIndex(index)
combobox.activated.connect(self.setup_params_catalog)
if len(self.catalog_server_options) > 0:
self.setup_params_catalog(index, redo=False)
btns = QtHelp.HBox()
btns.setSpacing(5)
btn = QtGui.QRadioButton("Rectangle")
if self.drawtype == 'rectangle':
btn.setChecked(True)
btn.toggled.connect(lambda tf: self.set_drawtype_cb(tf, 'rectangle'))
btns.addWidget(btn, stretch=0, alignment=QtCore.Qt.AlignLeft)
btn = QtGui.QRadioButton("Circle")
#.........这里部分代码省略.........
示例14: build_gui
# 需要导入模块: from ginga.qtw import QtHelp [as 别名]
# 或者: from ginga.qtw.QtHelp import build_info [as 别名]
def build_gui(self, container):
sw = QtGui.QScrollArea()
twidget = QtHelp.VBox()
sp = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding,
QtGui.QSizePolicy.Fixed)
twidget.setSizePolicy(sp)
vbox = twidget.layout()
vbox.setContentsMargins(4, 4, 4, 4)
vbox.setSpacing(2)
sw.setWidgetResizable(True)
sw.setWidget(twidget)
# COLOR MAPPING OPTIONS
fr = QtHelp.Frame("Colors")
captions = (('Colormap', 'combobox', 'Intensity', 'combobox'),
('Algorithm', 'combobox', 'Table Size', 'entry'),
('Color Defaults', 'button'))
w, b = QtHelp.build_info(captions)
self.w.cmap_choice = b.colormap
self.w.imap_choice = b.intensity
self.w.calg_choice = b.algorithm
self.w.table_size = b.table_size
b.color_defaults.clicked.connect(self.set_default_maps)
b.colormap.setToolTip("Choose a color map for this image")
b.intensity.setToolTip("Choose an intensity map for this image")
b.algorithm.setToolTip("Choose a color mapping algorithm")
b.table_size.setToolTip("Set size of the color mapping table")
b.color_defaults.setToolTip("Restore default color and intensity maps")
fr.layout().addWidget(w, stretch=1, alignment=QtCore.Qt.AlignLeft)
vbox.addWidget(fr, stretch=0, alignment=QtCore.Qt.AlignTop)
combobox = b.colormap
options = []
index = 0
for name in self.cmap_names:
options.append(name)
combobox.addItem(name)
index += 1
cmap_name = self.t_.get('color_map', "ramp")
try:
index = self.cmap_names.index(cmap_name)
except Exception:
index = self.cmap_names.index('ramp')
combobox.setCurrentIndex(index)
combobox.activated.connect(self.set_cmap_cb)
combobox = b.intensity
options = []
index = 0
for name in self.imap_names:
options.append(name)
combobox.addItem(name)
index += 1
imap_name = self.t_.get('intensity_map', "ramp")
try:
index = self.imap_names.index(imap_name)
except Exception:
index = self.imap_names.index('ramp')
combobox.setCurrentIndex(index)
combobox.activated.connect(self.set_imap_cb)
combobox = b.algorithm
options = []
index = 0
for name in self.calg_names:
options.append(name)
combobox.addItem(name)
index += 1
index = self.calg_names.index(self.t_.get('color_algorithm', "linear"))
combobox.setCurrentIndex(index)
combobox.activated.connect(self.set_calg_cb)
entry = b.table_size
entry.setText(str(self.t_.get('color_hashsize', 65535)))
entry.returnPressed.connect(lambda: self.set_tablesize_cb(entry))
# ZOOM OPTIONS
fr = QtHelp.Frame("Zoom")
captions = (('Zoom Alg', 'combobox', 'Zoom Rate', 'spinfloat'),
('Stretch XY', 'combobox', 'Stretch Factor', 'spinfloat'),
('Scale X', 'entry', 'Scale Y', 'entry'),
('Scale Min', 'spinfloat', 'Scale Max', 'spinfloat'),
('Zoom Defaults', 'button'))
w, b = QtHelp.build_info(captions)
self.w.update(b)
index = 0
for name in self.zoomalg_names:
b.zoom_alg.addItem(name.capitalize())
index += 1
zoomalg = self.t_.get('zoom_algorithm', "step")
index = self.zoomalg_names.index(zoomalg)
b.zoom_alg.setCurrentIndex(index)
b.zoom_alg.setToolTip("Choose Zoom algorithm")
b.zoom_alg.activated.connect(self.set_zoomalg_cb)
index = 0
#.........这里部分代码省略.........
示例15: _create_info_window
# 需要导入模块: from ginga.qtw import QtHelp [as 别名]
# 或者: from ginga.qtw.QtHelp import build_info [as 别名]
def _create_info_window(self):
sw = QtGui.QScrollArea()
widget = QtGui.QWidget()
vbox = QtGui.QVBoxLayout()
vbox.setContentsMargins(2, 2, 2, 2)
widget.setLayout(vbox)
captions = (('Name', 'label'), ('Object', 'label'),
('X', 'label'), ('Y', 'label'), ('Value', 'label'),
('RA', 'label'), ('DEC', 'label'),
('Equinox', 'label'), ('Dimensions', 'label'),
#('Slices', 'label', 'MultiDim', 'button'),
('Min', 'label'), ('Max', 'label'),
('Zoom', 'label'),
('Cut Low', 'xlabel', '@Cut Low', 'entry'),
('Cut High', 'xlabel', '@Cut High', 'entry'),
('Auto Levels', 'button', 'Cut Levels', 'button'),
('Cut New', 'label'), ('Zoom New', 'label'),
('Preferences', 'button'),
)
w, b = QtHelp.build_info(captions)
b.cut_levels.setToolTip("Set cut levels manually")
b.auto_levels.setToolTip("Set cut levels by algorithm")
b.cut_low.setToolTip("Set low cut level (press Enter)")
b.cut_high.setToolTip("Set high cut level (press Enter)")
b.preferences.setToolTip("Set preferences for this channel")
#b.multidim.setToolTip("View other HDUs or slices")
vbox.addWidget(w, stretch=0)
# Convenience navigation buttons
btns = QtGui.QWidget()
layout = QtGui.QHBoxLayout()
layout.setSpacing(3)
btns.setLayout(layout)
#btns.set_layout(gtk.BUTTONBOX_CENTER)
#btns.set_child_size(15, -1)
bw = Bunch.Bunch()
for tup in (
#("Load", 'button', 'fits_open_48', "Open an image file"),
("Prev", 'button', 'prev_48', "Go to previous image"),
("Next", 'button', 'next_48', "Go to next image"),
("Zoom In", 'button', 'zoom_in_48', "Zoom in"),
("Zoom Out", 'button', 'zoom_out_48', "Zoom out"),
("Zoom Fit", 'button', 'zoom_fit_48', "Zoom to fit window size"),
("Zoom 1:1", 'button', 'zoom_100_48', "Zoom to 100% (1:1)"),
#("Quit", 'button', 'exit', "Quit the program"),
):
btn = self.fv.make_button(*tup)
name = tup[0]
if tup[3]:
btn.setToolTip(tup[3])
bw[QtHelp._name_mangle(name, pfx='btn_')] = btn
layout.addWidget(btn, stretch=0)
#self.w.btn_load.connect("clicked", lambda w: self.gui_load_file())
bw.btn_prev.clicked.connect(self.fv.prev_img)
bw.btn_next.clicked.connect(self.fv.next_img)
bw.btn_zoom_in.clicked.connect(self.fv.zoom_in)
bw.btn_zoom_out.clicked.connect(self.fv.zoom_out)
bw.btn_zoom_fit.clicked.connect(self.fv.zoom_fit)
bw.btn_zoom_1_1.clicked.connect(self.fv.zoom_1_to_1)
vbox.addWidget(btns, stretch=0)
#widget.show()
sw.setWidget(widget)
return sw, b