Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions RMS/Routines/CustomPyqtgraphClasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from RMS.Formats.FFfile import reconstructFrame as reconstructFrameFF
from RMS.Routines import Image
from RMS.Routines.DebruijnSequence import findAllInDeBruijnSequence, generateDeBruijnSequence
from PyQt5.QtWidgets import QDialog, QVBoxLayout, QLabel, QComboBox, QPushButton, QSizePolicy

import time
import re
Expand Down Expand Up @@ -169,6 +170,37 @@ def setIcon(self, icon):
pass


class ComboDialog(QDialog):
def __init__(self, options_dict, window_title="Select", label="Options"):
super().__init__()

self.resize(300,100)
self.setWindowTitle(window_title)

# Layout
layout = QVBoxLayout()

# Label
self.label = QLabel(label)
layout.addWidget(self.label)

# Combo Box
self.combo = QComboBox()
self.combo.addItems(options_dict.keys())
layout.addWidget(self.combo)

# Button

ok_button = QPushButton("OK")
ok_button.clicked.connect(self.accept)
layout.addWidget(ok_button)

self.setLayout(layout)

def get_selection(self):
return self.combo.currentText()


class TextItemList(pg.GraphicsObject):
"""
Allows for a list of TextItems without having to constantly add items to a widget
Expand Down
Loading