diff options
Diffstat (limited to 'korundum/rubylib/examples/uimodules')
-rw-r--r-- | korundum/rubylib/examples/uimodules/uidialogs.rb | 256 | ||||
-rw-r--r-- | korundum/rubylib/examples/uimodules/uimenus.rb | 137 | ||||
-rw-r--r-- | korundum/rubylib/examples/uimodules/uimisc.rb | 273 | ||||
-rw-r--r-- | korundum/rubylib/examples/uimodules/uiwidgets.rb | 827 | ||||
-rw-r--r-- | korundum/rubylib/examples/uimodules/uixml.rb | 56 |
5 files changed, 1549 insertions, 0 deletions
diff --git a/korundum/rubylib/examples/uimodules/uidialogs.rb b/korundum/rubylib/examples/uimodules/uidialogs.rb new file mode 100644 index 00000000..2d264a4b --- /dev/null +++ b/korundum/rubylib/examples/uimodules/uidialogs.rb @@ -0,0 +1,256 @@ +=begin +This is a ruby version of Jim Bublitz's pykde program, translated by Richard Dale +=end + +require 'Korundum' + +module UIDialogs + +class CustomDlg < KDE::Dialog + + slots 'dlgClicked()', 'okClicked()', 'cancelClicked()' + + def initialize(parent, name = "custom dlg", modal = false) + super(parent, name, modal) + + x = 20 + y = 10 + + rLbl = Qt::Label.new("r", self) + gLbl = Qt::Label.new("g", self) + bLbl = Qt::Label.new("b", self) + @rEd = Qt::LineEdit.new("64", self) + @gEd = Qt::LineEdit.new("64", self) + @bEd = Qt::LineEdit.new("64", self) + dlgBtn = Qt::PushButton.new("Set/Get Color", self) + okBtn = Qt::PushButton.new("OK", self) + canBtn = Qt::PushButton.new("Cancel", self) + + rLbl.setGeometry(x, y, 25, 20) + gLbl.setGeometry(x + 30, y, 25, 20) + bLbl.setGeometry(x + 60, y, 25, 20) + y = y + 20 + @rEd.setGeometry(x, y, 25, 20) + @gEd.setGeometry(x + 30, y, 25, 20) + @bEd.setGeometry(x + 60, y, 25, 20) + y = y + 30 + dlgBtn.setGeometry(x, y, 90, 22) + y = y + 30 + okBtn.setGeometry(x, y, 40, 22) + canBtn.setGeometry(x + 50, y, 40, 22) + + connect(dlgBtn, SIGNAL("clicked()"), SLOT('dlgClicked()')) + connect(okBtn, SIGNAL("clicked()"), SLOT('okClicked()')) + connect(canBtn, SIGNAL("clicked()"), SLOT('cancelClicked()')) + end + + def dlgClicked() + # get some(numerical) color values from the original dialog + red = @rEd.text().to_i + green = @gEd.text().to_i + blue = @bEd.text().to_I + + # convert the numbers to a Qt::Color + color = Qt::Color.new(red, green, blue) + + # invoke the dialog(getColor is a 'static' call) + # initialize with the colors from above(in color) + # color will also hold the new value chosen in the + # KDE::ColorDialog + result = KDE::ColorDialog.getColor(color, self) + + # get the numerical color values back +# red, green, blue = color.rgb() + + # update the Qt::LineEdits in the original dialog + @rEd.setText(red.to_s) + @gEd.setText(green.to_s) + @bEd.setText(blue.to_s) + end + + def okClicked() + done(1) + end + + def cancelClicked() + done(0) + end +end + +class MessageDlg < KDE::Dialog + + slots 'launch(int)' + + def initialize(parent, name = "message dlg", modal = false) + super(parent, name, modal) + + buttons = ["QuestionYesNo", "WarningYesNo", "WarningContinueCancel", "WarningYesNoCancel", + "Information", "SSLMessageBox", "Sorry", "Error", "QuestionYesNoCancel"] + + n = buttons.length + + grp = Qt::ButtonGroup.new(n, Qt::Vertical, "MessageBoxes", self, "button grp") + grp.setGeometry(10, 10, 200, 30*n) + (0...n).each { |i| Qt::RadioButton.new(buttons[i], grp) } + + connect(grp, SIGNAL("clicked(int)"), SLOT('launch(int)')) + end + + def launch(which) + which += 1 # Qt::ButtonGroup id's start at 0, but the KDE::MessageBox enum starts at 1 + + if which == KDE::MessageBox::QuestionYesNo + KDE::MessageBox.questionYesNo(self, "This is a questionYesNo message box\nThere is also a list version of this dialog",\ + "questionYesNo") + + elsif which == KDE::MessageBox::WarningYesNo + KDE::MessageBox.warningYesNo(self, "This is a warningYesNo message box", "warningYesNo") + + elsif which == KDE::MessageBox::WarningContinueCancel + KDE::MessageBox.warningContinueCancel(self, "This is a warningContinueCancel message box", "warningContinueCancel"); + + elsif which == KDE::MessageBox::WarningYesNoCancel + KDE::MessageBox.warningYesNoCancel(self, "This is a warningYesNoCancel message box", "warningYesNoCancel") + + elsif which == KDE::MessageBox::Information + KDE::MessageBox.information(self, "This is an information message box", "Information") + +# elsif which == KDE::MessageBox::SSLMessageBox +# KDE::MessageBox.SSLMessageBox(self, "This is an SSLMessageBox message box", "not implemented yet") + + elsif which == KDE::MessageBox::Sorry + KDE::MessageBox.sorry(self, "This is a 'sorry' message box", "Sorry") + + elsif which == KDE::MessageBox::Error + KDE::MessageBox.error(self, "No - this isn't really an error\nIt's an error message box\n", "Error") + + elsif which == KDE::MessageBox::QuestionYesNoCancel + KDE::MessageBox.questionYesNoCancel(self, "No - this isn't really an error\nIt's an QuestionYesNoCancel message box\n", "QuestionYesNoCancel") + end + end +end + + +def UIDialogs.dlgKAboutDialog(parent) + dlg = KDE::AboutDialog.new(parent, 'about dialog', false) + dlg.setLogo(Qt::Pixmap.new("rbtestimage.png")) + dlg.setTitle("UISampler for Korundum") + dlg.setAuthor("Jim Bublitz", "jbublitz@nwinternet.com", "http://www.riverbankcomputing.co.uk", + "\n\nPyKDE -- Python bindings\n\tfor KDE") + dlg.setMaintainer("Richard Dale", "Richard_Dale@tipitina.demon.co.uk", "http://developer.kde.org/language-bindings/ruby/",\ + "\n\nKorundum -- Ruby bindings\n\tfor KDE") + dlg.addContributor("KDE bindings list", "kde-bindings@kde.org", nil, nil) + + dlg.show() +end + + +def UIDialogs.dlgKBugReport(parent) + dlg = KDE::BugReport.new(parent) + dlg.exec() +end + +def UIDialogs.dlgKAboutKDE(parent) + dlg = KDE::AboutKDE.new(parent, "about kde", false) + dlg.show() +end + +def UIDialogs.dlgKColorDialog(parent) + dlg = KDE::ColorDialog.new(parent, "color dlg", false) + dlg.show() +end + +def UIDialogs.dlgKDialog(parent) + dlg = CustomDlg.new(parent) + dlg.show() +end + +def UIDialogs.dlgKDialogBase(parent) + caption = "KDialogBase sample" + text_ = "This is a KDialogBase example" + dlg = KDE::DialogBase.new(parent, "sample_dialog", false, caption, + KDE::DialogBase::Ok | KDE::DialogBase::Cancel, KDE::DialogBase::Ok, true ) + + page = dlg.makeVBoxMainWidget(); + + # making 'page' the parent inserts the widgets in + # the VBox created above + label = Qt::Label.new( caption, page, "caption" ); + + lineedit = Qt::LineEdit.new(text_, page, "lineedit" ); + lineedit.setMinimumWidth(dlg.fontMetrics().maxWidth()*20); + + label0 = Qt::Label.new("Border widths", page) +# widths = dlg.getBorderWidths() +# labelA = Qt::Label.new("Upper Left X: " + widths[0].to_s, page) +# labelB = Qt::Label.new("Upper Left Y: " + widths[0].to_s, page) +# labelC = Qt::Label.new("Lower Right X: " + str(c), page) +# labelD = Qt::Label.new("Lower Right Y: " + str(d), page) + + dlg.show() +end + +def UIDialogs.dlgKFontDialog(parent) + dlg = KDE::FontDialog.new(parent, "font dlg", false, false) + dlg.show() +end + +def UIDialogs.dlgKKeyDialog(parent) + # This really doesn't do anything except pop up the dlg + keys = KDE::Accel.new(parent) +# keys.insertItem( i18n( "Zoom in" ), "Zoom in", "+" ) + keys.readSettings(); + KDE::KeyDialog.configure(keys, true) +end + +def UIDialogs.dlgKInputDialog(parent) + ok = Qt::Boolean.new + result = KDE::InputDialog.getText("Enter text", "", "<Your input here>", ok) +# puts "result: %s" % result +# puts "ok: %s" % ok + + # pop up another dlg to show what happened in the KDE::LineEditDlg + if !ok.nil? + KDE::MessageBox.information(parent, "OK was pressed\nText: " + result, "KDE::InputDialog result") + else + KDE::MessageBox.information(parent, "Cancel pressed\nText", "KDE::InputDialog result") + end +end + +def UIDialogs.dlgKMessageBox(parent) + dlg = MessageDlg.new(parent) + dlg.show() +end + +def UIDialogs.dlgKPasswordDialog(parent) + password = "" + result = KDE::PasswordDialog.getPassword(password, "Enter password(just a test)") + puts "password: #{password}" +end + +def UIDialogs.dlgKWizard(parent) + wiz = KDE::Wizard.new(parent) + + page1 = Qt::Widget.new(wiz) + p1Lbl = Qt::Label.new("This is page 1", page1) + p1Lbl.setGeometry(20, 20, 100, 20) + page2 = Qt::Widget.new(wiz) + p2Lbl = Qt::Label.new("This is page 2", page2) + p2Lbl.setGeometry(50, 20, 100, 20) + page3 = Qt::Widget.new(wiz) + p3Lbl = Qt::Label.new("This is page 3", page3) + p3Lbl.setGeometry(80, 20, 100, 20) + + wiz.addPage(page1, "Page 1") + wiz.addPage(page2, "Page 2") + wiz.addPage(page3, "Page 3") + wiz.show() +end + +if $0 == __FILE__ + puts + puts "Please run uisampler.rb" + puts +end + +end diff --git a/korundum/rubylib/examples/uimodules/uimenus.rb b/korundum/rubylib/examples/uimodules/uimenus.rb new file mode 100644 index 00000000..4a8ff523 --- /dev/null +++ b/korundum/rubylib/examples/uimodules/uimenus.rb @@ -0,0 +1,137 @@ +=begin +This is a ruby version of Jim Bublitz's pykde program, translated by Richard Dale +=end + +require 'Korundum' + +module UIMenus + +class PageLaunch + def initialize(parent) + page = parent.addPage() + + x = 10 + y = 10 + + launchLbl = Qt::Label.new("Launching application ... please wait\n\nClose launched application to continue", page) + launchLbl.setGeometry(x, y, 300, 80) + launchLbl.show() + + page.show() + + $kapp.processEvents() + end +end + + +class PageNotImpl + def initialize(parent) + page = parent.addPage() + + x = 10 + y = 10 + + niLbl = Qt::Label.new("Nothing is currently implemented for this widget", page) + niLbl.setGeometry(x, y, 300, 20) + niLbl.show() + end +end + +def UIMenus.menuKAccelGen(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIMenus.menuKAccelMenu(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIMenus.menuKAction(parent) + parent.currentPageObj = PageLaunch.new(parent) + system("ruby menudemo.rb") +end + +def UIMenus.menuKActionMenu(parent) + parent.currentPageObj = PageLaunch.new(parent) + system("ruby menudemo.rb") +end + +def UIMenus.menuKActionSeparator(parent) + parent.currentPageObj = PageLaunch.new(parent) + system("ruby menudemo.rb") +end + +def UIMenus.menuKContextMenuManager(parent) +# pass +end + +def UIMenus.menuKDCOPActionProxy(parent) +# pass +end + +def UIMenus.menuKHelpMenu(parent) + parent.currentPageObj = PageLaunch.new(parent) + system("ruby menudemo.rb") +end + +def UIMenus.menuKMenuBar(parent) + parent.currentPageObj = PageLaunch.new(parent) + system("ruby menudemo.rb") +end + +def UIMenus.menuKPanelApplet(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIMenus.menuKPanelExtension(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIMenus.menuKPanelMenu(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIMenus.menuKPopupFrame(parent) +# pass +end + +def UIMenus.menuKPopupMenu(parent) +# pass +end + +def UIMenus.menuKPopupTitle(parent) +# pass +end + +def UIMenus.menuKStatusBar(parent) + parent.currentPageObj = PageLaunch.new(parent) + system("ruby menudemo.rb") +end + +def UIMenus.menuKStatusBarLabel(parent) + parent.currentPageObj = PageLaunch.new(parent) + system("ruby menudemo.rb") +end + +def UIMenus.menuKStdAction(parent) + parent.currentPageObj = PageLaunch.new(parent) + system("ruby menudemo.rb") +end + +def UIMenus.menuKToolBar(parent) + parent.currentPageObj = PageLaunch.new(parent) + system("ruby menudemo.rb") +end + +def UIMenus.menuKWindowListMenu(parent) +# pass +end + + +if $0 == __FILE__ + puts + puts "Please run uisampler.rb" + puts +end + +end + diff --git a/korundum/rubylib/examples/uimodules/uimisc.rb b/korundum/rubylib/examples/uimodules/uimisc.rb new file mode 100644 index 00000000..f9d70161 --- /dev/null +++ b/korundum/rubylib/examples/uimodules/uimisc.rb @@ -0,0 +1,273 @@ +=begin +This is a ruby version of Jim Bublitz's pykde program, translated by Richard Dale +=end + +require 'Korundum' + +module UIMisc + +class Page3 < Qt::Object + slots 'ivChanged()', 'fvChanged()', 'dvChanged()' + + def initialize(parent) + super + page = parent.addPage() + x = 10 + y = 15 + + green = Qt::Color.new(0, 255, 0) + yellow = Qt::Color.new(255, 255, 0) + red = Qt::Color.new(255, 0, 0) + + ivLbl = Qt::Label.new("KIntValidator", page) + ivLbl.setGeometry(x, y, 100, 20) + ivLbl.show() + + @iv = KDE::LineEdit.new(page) + @iv.setGeometry(x, y + 20, 100, 20) + @iv.show() + connect(@iv, SIGNAL("textChanged(const QString&)"), SLOT('ivChanged()')) + + @ivVal = KDE::IntValidator.new(page) + @ivVal.setRange(20, 50) + + ivRngLbl = Qt::Label.new("Range is 20 - 50", page) + ivRngLbl.setGeometry(x, y + 45, 100, 20) + ivRngLbl.show() + + ivAccLbl = Qt::Label.new("Acceptable", page) + ivAccLbl.setGeometry(x + 125, y + 45, 85, 20) + ivAccLbl.show() + ivInterLbl = Qt::Label.new("Intermediate", page) + ivInterLbl.setGeometry(x + 125, y + 20, 85, 20) + ivInterLbl.show() + ivInvalLbl = Qt::Label.new("Invalid", page) + ivInvalLbl.setGeometry(x + 125, y - 5, 85, 20) + ivInvalLbl.show() + @ivInvalLed = KDE::Led.new(red, KDE::Led::Off, KDE::Led::Sunken, KDE::Led::Circular,page) + @ivInvalLed.setGeometry(x + 215, y - 5, 18, 18) + @ivInvalLed.show() + @ivInterLed = KDE::Led.new(yellow, KDE::Led::Off, KDE::Led::Sunken, KDE::Led::Circular,page) + @ivInterLed.setGeometry(x + 215, y + 20, 18, 18) + @ivInterLed.show() + @ivAccLed = KDE::Led.new(green, KDE::Led::On, KDE::Led::Sunken, KDE::Led::Circular,page) + @ivAccLed.setGeometry(x + 215, y + 45, 18, 18) + @ivAccLed.show() + + y = y + 100 + + fvLbl = Qt::Label.new("KDoubleValidator", page) + fvLbl.setGeometry(x, y, 100, 20) + fvLbl.show() + + @fv = KDE::LineEdit.new(page) + @fv.setGeometry(x, y + 20, 100, 20) + @fv.show() + connect(@fv, SIGNAL("textChanged(const QString&)"), SLOT('fvChanged()')) + + @fvVal = KDE::DoubleValidator.new(page) + @fvVal.setRange(10.0, 40.0) + + fvRngLbl = Qt::Label.new("Range is 10.0 - 40.0", page) + fvRngLbl.setGeometry(x, y + 45, 100, 20) + fvRngLbl.show() + + fvAccLbl = Qt::Label.new("Acceptable", page) + fvAccLbl.setGeometry(x + 125, y + 45, 85, 20) + fvAccLbl.show() + fvInterLbl = Qt::Label.new("Intermediate", page) + fvInterLbl.setGeometry(x + 125, y + 20, 95, 20) + fvInterLbl.show() + fvInvalLbl = Qt::Label.new("Invalid", page) + fvInvalLbl.setGeometry(x + 125, y - 5, 85, 20) + fvInvalLbl.show() + @fvInvalLed = KDE::Led.new(red, KDE::Led::Off, KDE::Led::Sunken, KDE::Led::Circular,page) + @fvInvalLed.setGeometry(x + 215, y - 5, 18, 18) + @fvInvalLed.show() + @fvInterLed = KDE::Led.new(yellow, KDE::Led::Off, KDE::Led::Sunken, KDE::Led::Circular,page) + @fvInterLed.setGeometry(x + 215, y + 20, 18, 18) + @fvInterLed.show() + @fvAccLed = KDE::Led.new(green, KDE::Led::On, KDE::Led::Sunken, KDE::Led::Circular,page) + @fvAccLed.setGeometry(x + 215, y + 45, 18, 18) + @fvAccLed.show() + + y = y + 100 + + dvLbl = Qt::Label.new("KDateValidator", page) + dvLbl.setGeometry(x, y, 100, 20) + dvLbl.show() + + @dv = KDE::LineEdit.new(page) + @dv.setGeometry(x, y + 20, 100, 20) + @dv.show() +# connect(dv, SIGNAL("textChanged(const QString&)"), SLOT('dvChanged()')) + + @dvVal = KDE::DateValidator.new(page) +# dvVal.setRange(10.0, 40.0) + +# dvRngLbl = Qt::Label.new("Range is 10.0 - 40.0", page) +# dvRngLbl.setGeometry(x, y + 45, 100, 20) +# dvRngLbl.show() + + dvBtn = Qt::PushButton.new("Validate", page) + dvBtn.setGeometry(x, y + 45, 60, 22) + dvBtn.show() + connect(dvBtn, SIGNAL("clicked()"), SLOT('dvChanged()')) + + dvNoteLbl = Qt::Label.new("Format is locale dependent\nShort date only\nTry DD-MM-YY", page) + dvNoteLbl.setGeometry(x, y + 70, 150, 60) + dvNoteLbl.show() + + dvAccLbl = Qt::Label.new("Acceptable", page) + dvAccLbl.setGeometry(x + 125, y + 45, 85, 20) + dvAccLbl.show() + dvInterLbl = Qt::Label.new("Intermediate", page) + dvInterLbl.setGeometry(x + 125, y + 20, 85, 20) + dvInterLbl.show() + dvInvalLbl = Qt::Label.new("Invalid", page) + dvInvalLbl.setGeometry(x + 125, y - 5, 85, 20) + dvInvalLbl.show() + @dvInvalLed = KDE::Led.new(red, KDE::Led::Off, KDE::Led::Sunken, KDE::Led::Circular,page) + @dvInvalLed.setGeometry(x + 215, y - 5, 18, 18) + @dvInvalLed.show() + @dvInterLed = KDE::Led.new(yellow, KDE::Led::Off, KDE::Led::Sunken, KDE::Led::Circular,page) + @dvInterLed.setGeometry(x + 215, y + 20, 18, 18) + @dvInterLed.show() + @dvAccLed = KDE::Led.new(green, KDE::Led::On, KDE::Led::Sunken, KDE::Led::Circular,page) + @dvAccLed.setGeometry(x + 215, y + 45, 18, 18) + @dvAccLed.show() + end + + def ivChanged() + @ivInvalLed.off() + @ivInterLed.off() + @ivAccLed.off() + + i = Qt::Integer.new(0) + state = @ivVal.validate(@iv.text(), i) + + if state == Qt::Validator::Acceptable + @ivAccLed.on() + elsif state == Qt::Validator::Intermediate + @ivInterLed.on() + else + @ivInvalLed.on() + end + end + + def fvChanged() + @fvInvalLed.off() + @fvInterLed.off() + @fvAccLed.off() + + i = Qt::Integer.new(0) + state = @fvVal.validate(@fv.text(), i) + + if state == Qt::Validator::Acceptable + @fvAccLed.on() + elsif state == Qt::Validator::Intermediate + @fvInterLed.on() + else + @fvInvalLed.on() + end + end + + def dvChanged() + @dvInvalLed.off() + @dvInterLed.off() + @dvAccLed.off() + + i = Qt::Integer.new(0) + state = @dvVal.validate(@dv.text(), i) + + if state == Qt::Validator::Acceptable + @dvAccLed.on() + elsif state == Qt::Validator::Intermediate + @dvInterLed.on() + else + @dvInvalLed.on() + end + end +end + +class PageNotImpl + def initialize(parent) + page = parent.addPage() + + x = 10 + y = 10 + + niLbl = Qt::Label.new("Nothing is currently implemented for this widget", page) + niLbl.setGeometry(x, y, 300, 20) + niLbl.show() + end +end + +def UIMisc.miscKAlphaPainter(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIMisc.miscKCModule(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIMisc.miscKColor(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIMisc.miscKColorDrag(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIMisc.miscKCommand(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIMisc.miscKCommandHistory(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIMisc.miscKDockWindow(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIMisc.miscKDoubleValidator(parent) + parent.currentPageObj = Page3.new(parent) +end + +def UIMisc.miscKDateValidator(parent) + parent.currentPageObj = Page3.new(parent) +end + +def UIMisc.miscKIntValidator(parent) + parent.currentPageObj = Page3.new(parent) +end + +def UIMisc.miscKPixmapIO(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIMisc.miscKSharedPixmap(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIMisc.miscKSystemTray(parent) + KDE::MessageBox.information(parent, "See the systray.rb example in the templates/ subdirectories") +end + +def UIMisc.miscKThemeBase(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIMisc.miscQXEmbed(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +if $0 == __FILE__ + puts + puts "Please run uisampler.rb" + puts +end + +end + diff --git a/korundum/rubylib/examples/uimodules/uiwidgets.rb b/korundum/rubylib/examples/uimodules/uiwidgets.rb new file mode 100644 index 00000000..8dd79d49 --- /dev/null +++ b/korundum/rubylib/examples/uimodules/uiwidgets.rb @@ -0,0 +1,827 @@ +=begin +This is a ruby version of Jim Bublitz's pykde program, translated by Richard Dale +=end + +require 'Korundum' + +module UIWidgets + +class Page1 < Qt::Object + slots 'restrict(int)' + + def initialize(parent) + super + page = parent.addPage() + + x = 10 + y = 10 + + editLbl = Qt::Label.new("KTextEdit", page) + editLbl.setGeometry(x, y, 50, 20) + editLbl.show() + + textList = ["Now is the winter of our discontent\n", + "made glorious summer by this sun of York;\n", + "and all the clouds that lour'd upon our house\n", + "in the deep bosom of the ocean buried.\n"] + + parent.edit = KDE::TextEdit.new(page) + parent.edit.setGeometry(x, y + 20, 300, 100) + textList.each do |line| + parent.edit.insert(line) + end + parent.edit.show() + + y = y + 125 + searchBtn = Qt::PushButton.new("Search", page) + replaceBtn = Qt::PushButton.new("Replace", page) + gotoBtn = Qt::PushButton.new("GoTo Line", page) + + searchBtn.setGeometry(x, y, 60, 22) + replaceBtn.setGeometry(x + 90, y, 60, 22) + gotoBtn.setGeometry(x + 180, y, 60, 22) + +# page.connect(searchBtn, SIGNAL("clicked()"), parent.edit, SLOT('search()')) +# page.connect(replaceBtn, SIGNAL("clicked()"), parent.edit, SLOT('replace()')) +# page.connect(gotoBtn, SIGNAL("clicked()"), parent.edit, SLOT('doGotoLine()')) + + searchBtn.show() + replaceBtn.show() + gotoBtn.show() + + y = y + 35 + + lineeditLbl = Qt::Label.new("KLineEdit", page) + lineeditLbl.setGeometry(x, y, 70, 20) + lineeditLbl.show() + + lineedit = KDE::LineEdit.new(page) + lineedit.setGeometry(x, y + 20, 100, 20) + lineedit.show() + + intLbl = Qt::Label.new("KIntNumInput", page) + intLbl.setGeometry(x + 195, y + 35, 95, 20) + intLbl.show() + + intNum = KDE::IntNumInput.new(5, page) + intNum.setGeometry(x + 195, y + 55, 175, 50) +# intNum.setSuffix(" GB") +# intNum.setPrefix("hdc ") + intNum.setLabel("Capacity") + intNum.setRange(0, 10, 1, true) + intNum.show() + + y = y + 50 + + dblLbl = Qt::Label.new("KDoubleNumInput", page) + dblLbl.setGeometry(x + 195, y + 80, 115, 20) + dblLbl.show() + + dblNum = KDE::DoubleNumInput.new(page) + dblNum.setValue(2.5) + dblNum.setGeometry(x + 195, y + 100, 175, 50) + dblNum.setLabel("Variable") + dblNum.setRange(0.0, 10.0, 0.5, true) + dblNum.show() + + restricteditLbl = Qt::Label.new("KRestrictedLine", page) + restricteditLbl.setGeometry(x, y, 95, 20) + restricteditLbl.show() + + @restrictlineedit = KDE::RestrictedLine.new(page) + @restrictlineedit.setGeometry(x, y + 20, 100, 20) + @restrictlineedit.show() + + buttons = ["Numbers Only", "Upper Case Only", "Lower Case Only"] + + n = buttons.length + + @validLbl = Qt::Label.new("", page) + @validLbl.setGeometry(x, y + 50, 250, 20) + @validLbl.show() + + grp = Qt::ButtonGroup.new(n, Qt::Vertical, "Select valid chars", page, "button grp") + grp.setGeometry(x, y + 75, 150, 5+30*n) + + (0...n).each { |i| Qt::RadioButton.new(buttons[i], grp) } + + connect(grp, SIGNAL("clicked(int)"), SLOT('restrict(int)')) + + grp.find(0).setChecked(true) + restrict(0) + + grp.show() + + page.show() + $kapp.processEvents() + + y = y + 195 + sqzLbl = Qt::Label.new("This text is too long to fit in the label below", page) + sqzLbl.setGeometry(x, y, 350, 20) + sqzLbl.show() + + sqzLbl1 = Qt::Label.new("KSqueezedTxtLabel:", page) + sqzLbl1.setGeometry(x, y + 20, 120, 20) + sqzLbl1.show() + + squeeze = KDE::SqueezedTextLabel.new("This text is too long to fit in the label below", page) + squeeze.setGeometry(x + 125, y + 20, 125, 20) + squeeze.setBackgroundMode(Qt::Widget::PaletteBase) + squeeze.show() + end + + def restrict(which) + r = {0 => "0123456789", 1 => "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 2 => "abcdefghijklmnopqrstuvwxyz"} + @restrictlineedit.setValidChars(r[which]) + @validLbl.setText("Valid: " + @restrictlineedit.validChars()) + end +end + +class Page2 + def initialize(parent) + page = parent.addPage() + + x1 = 10 + y1 = 10 + x2 = 240 + y2 = 100 + + cbLbl = Qt::Label.new("KComboBox", page) + cbLbl.setGeometry(x1, y1, 75, 20) + cbLbl.show() + + combo = KDE::ComboBox.new(page) + combo.insertStringList(["One", "Two", "Three"]) + combo.setGeometry(x1, y1 + 20, 100, 25) + combo.show() + + ccbLbl = Qt::Label.new("KColorCombo", page) + ccbLbl.setGeometry(x2, y1, 100, 20) + ccbLbl.show() + + colorCombo = KDE::ColorCombo.new(page) + colorCombo.setGeometry(x2, y1 + 20, 100, 25) + colorCombo.show() + + editListBox = KDE::EditListBox.new("KEditListBox", page) + editListBox.setGeometry(x1, y2, 220, 175) + editListBox.insertStringList(["One", "Two", "Three"]) + editListBox.show() + + lbLbl = Qt::Label.new("KListBox", page) + lbLbl.setGeometry(x2, y2, 100, 20) + lbLbl.show() + + listBox = KDE::ListBox.new(page) + listBox.setGeometry(x2, y2 + 20, 100, 100) + listBox.insertStringList(["One", "Two", "Three"]) + listBox.show() + end +end + +class Page3 + def initialize(parent) + page = parent.addPage() + + x = 10 + y = 10 + + fontLbl = Qt::Label.new("KFontChooser", page) + fontLbl.setGeometry(x, y, 95, 20) + fontLbl.show() + + fontChoose = KDE::FontChooser.new(page) + fontChoose.setGeometry(x, y + 20, 375, 300) + fontChoose.show() + + y = y + 330 + end +end + +class Page4 + def initialize(parent) + page = parent.addPage() + + x = 10 + y = 10 + + cbLbl = Qt::Label.new("KColorButton", page) + cbLbl.setGeometry(x, y, 75, 20) + cbLbl.show() + + cb = KDE::ColorButton.new(page) + cb.setColor(Qt::Color.new(255, 0, 0)) + cb.setGeometry(x, y + 20, 30, 30) + cb.show() + + ccbLbl = Qt::Label.new("KColorCombo", page) + ccbLbl.setGeometry(x + 150, y, 100, 20) + ccbLbl.show() + + colorCombo = KDE::ColorCombo.new(page) + colorCombo.setGeometry(x + 150, y + 20, 100, 25) + colorCombo.show() + + y = y + 60 + + cpLbl = Qt::Label.new("KColorPatch", page) + cpLbl.setGeometry(x, y, 75, 20) + cpLbl.show() + + cp = KDE::ColorPatch.new(page) + cp.setColor(Qt::Color.new(255, 0, 0)) + cp.setGeometry(x, y + 20, 20, 20) + cp.show() + + x = x + 150 + + ccLbl = Qt::Label.new("KColorCells", page) + ccLbl.setGeometry(x, y, 75, 20) + ccLbl.show() + + cc = KDE::ColorCells.new(page, 1, 5) + cc.setColor(0, Qt::Color.new(0, 0, 0)) + cc.setColor(1, Qt::Color.new(255, 0, 0)) + cc.setColor(2, Qt::Color.new(0, 255, 0)) + cc.setColor(3, Qt::Color.new(0, 0, 255)) + cc.setColor(4, Qt::Color.new(255, 255, 255)) + cc.setGeometry(x, y + 20, 100, 20) + cc.show() + + x = 10 + y = y + 50 + + dcLbl = Qt::Label.new("KDualColorButton", page) + dcLbl.setGeometry(x, y, 105, 20) + dcLbl.show() + + dc = KDE::DualColorButton.new(Qt::Color.new(255, 0, 0), Qt::Color.new(0, 0, 0), page) + dc.setGeometry(x, y + 20, 40, 40) + dc.show() + + gsLbl = Qt::Label.new("KGradientSelector", page) + gsLbl.setGeometry(x + 80, y + 30, 110, 20) + gsLbl.show() + + gs = KDE::GradientSelector.new(page) + gs.setGeometry(x + 80, y + 50, 250, 20) + gs.setColors(Qt::Color.new(255, 0, 0), Qt::Color.new(255, 255, 0)) + gs.show() + + y = y + 80 + + hsLbl = Qt::Label.new("KHSSelector", page) + hsLbl.setGeometry(x, y, 95, 20) + hsLbl.show() + + hs = KDE::HSSelector.new(page) + hs.setGeometry(x, y + 20, 350, 80) + hs.show() + + y = y + 110 + + ptLbl = Qt::Label.new("KPaletteTable", page) + ptLbl.setGeometry(x, y, 95, 20) + ptLbl.show() + + pt = KDE::PaletteTable.new(page, 340, 24) + pt.setPalette("Royal") + pt.setGeometry(x, y + 20, 340, 40) + pt.show() + end +end + +class Page5 + def initialize(parent) + page = parent.addPage() + + x = 10 + y = 10 + + rpLbl = Qt::Label.new("KRootPermsIcon", page) + rpLbl.setGeometry(x, y, 95, 20) + rpLbl.show() + + rp = KDE::RootPermsIcon.new(page) + rp.setGeometry(x, y + 20, 32, 32) + rp.show() + + wpLbl = Qt::Label.new("KWritePermsIcon", page) + wpLbl.setGeometry(x + 125, y, 95, 20) + wpLbl.show() + + wp = KDE::WritePermsIcon.new("/usr/bin/gcc", page) + wp.setGeometry(x + 125, y + 20, 32, 32) + wp.show() + + y = y + 75 + + pw1Lbl = Qt::Label.new("KPasswordEdit - echo *", page) + pw1Lbl.setGeometry(x, y, 150, 20) + pw1Lbl.show() + + pw1 = KDE::PasswordEdit.new(KDE::PasswordEdit::OneStar, page, "") + pw1.setGeometry(x, y + 20, 100, 20) + pw1.show() + + y = y + 50 + + pw2Lbl = Qt::Label.new("KPasswordEdit - echo ***", page) + pw2Lbl.setGeometry(x, y, 150, 20) + pw2Lbl.show() + + pw2 = KDE::PasswordEdit.new(KDE::PasswordEdit::ThreeStars, page, "") + pw2.setGeometry(x, y + 20, 100, 20) + pw2.show() + + y = y + 50 + + pw3Lbl = Qt::Label.new("KPasswordEdit - no echo", page) + pw3Lbl.setGeometry(x, y, 150, 20) + pw3Lbl.show() + + pw3 = KDE::PasswordEdit.new(KDE::PasswordEdit::NoEcho, page, "") + pw3.setGeometry(x, y + 20, 100, 20) + pw3.show() + + y = y + 50 + + urlLbl = Qt::Label.new("KURLLabel", page) + urlLbl.setGeometry(x, y, 100, 20) + urlLbl.show() + + url = KDE::URLLabel.new("http://developer.kde.org/language-bindings/ruby/", "Korundum", page) + url.setGeometry(x, y + 20, 100, 20) + url.setUseTips(true) + url.setTipText("http://developer.kde.org/language-bindings/ruby/") + url.show() + + x = 70 + y = y + 50 + + bbLbl = Qt::Label.new("KButtonBox", page) + bbLbl.setGeometry(x, y, 75, 20) + bbLbl.show() + + bbox = KDE::ButtonBox.new(page, Qt::Horizontal) + bbox.setGeometry(x, y + 20, 300, 22) + bbox.addButton("Button 1") + bbox.addButton("Button 2") + bbox.addButton("Button 3") + bbox.show() + + y = y + 50 + +# dbLbl = Qt::Label.new("KDirectionButton", page) +# dbLbl.setGeometry(x, y, 95, 20) +# dbLbl.show() + +# dbUp = KDE::DirectionButton.new(Qt::t::UpArrow, page) +# dbDown = KDE::DirectionButton.new(Qt::t::DownArrow, page) +# dbRight = KDE::DirectionButton.new(Qt::t::RightArrow, page) +# dbLeft = KDE::DirectionButton.new(Qt::t::LeftArrow, page) + +# dbUp.setGeometry(x, y + 20, 22, 22) +# dbDown.setGeometry(x + 30, y + 20, 22, 22) +# dbRight.setGeometry(x + 60, y + 20, 22, 22) +# dbLeft.setGeometry(x + 90, y + 20, 22, 22) + +# dbUp.show() +# dbDown.show() +# dbRight.show() +# dbLeft.show() + + x = x + 150 + +# kbLbl = Qt::Label.new("KKeyButton", page) +# kbLbl.setGeometry(x, y, 95, 20) +# kbLbl.show() + +# kb = KDE::KeyButton.new(page) +# kb.setText("Enter") +# kb.setGeometry(x, y + 20, 50, 32) +# kb.show() + + x = 70 + y = y + 50 + +# tbLbl = Qt::Label.new("KTabButton", page) +# tbLbl.setGeometry(x, y, 95, 20) +# tbLbl.show() + +# tbUp = KDE::TabButton.new(Qt::t::UpArrow, page) +# tbDown = KDE::TabButton.new(Qt::t::DownArrow, page) +# tbRight = KDE::TabButton.new(Qt::t::RightArrow, page) +# tbLeft = KDE::TabButton.new(Qt::t::LeftArrow, page) + +# tbUp.setGeometry(x, y + 20, 22, 25) +# tbDown.setGeometry(x + 30, y + 20, 22, 25) +# tbRight.setGeometry(x + 60, y + 20, 22, 25) +# tbLeft.setGeometry(x + 90, y + 20, 22, 25) + +# tbUp.show() +# tbDown.show() +# tbRight.show() +# tbLeft.show() + end +end + +class Page6 < Qt::Object + slots 'toggleClicked()' + + def initialize(parent) + super + page = parent.addPage() + + x = 20 + y = 10 + + red = Qt::Color.new(255, 0, 0) + green = Qt::Color.new(0, 255, 0) + yellow = Qt::Color.new(255, 255, 0) + blue = Qt::Color.new(0, 0, 255) + + ledcolor = [red, green, yellow, blue] + ledshape = [KDE::Led::Rectangular, KDE::Led::Circular] + ledlook = [KDE::Led::Flat, KDE::Led::Raised, KDE::Led::Sunken] + ledsize = [10, 18, 25] + @ledlist = [] + + ledlook.each do |look| + ledcolor.each do |color| + ledshape.each do |shape| + ledsize.each do |size| + led = KDE::Led.new(color, KDE::Led::On, look, shape, page) + led.setGeometry(x, y, size, size) + @ledlist << led + led.show() + x = x + 50 + end + x = x + 50 + end + x = 20 + y = y + 30 + end + y = y + 10 + end + + toggle = Qt::PushButton.new("Toggle", page) + toggle.setGeometry(150, 400, 60, 22) + toggle.show() + + connect(toggle, SIGNAL("clicked()"), SLOT('toggleClicked()')) + + page.show() + end + + def toggleClicked() + @ledlist.each { |led| led.toggle() } + end +end + +class Page7 < Qt::Object + slots 'add1()' + + def initialize(parent) + super + page = parent.addPage() + + x = 10 + y = 10 + + tabLbl = Qt::Label.new("KTabCtl", page) + tabLbl.setGeometry(x, y, 95, 20) + tabLbl.show() + + tab = KDE::TabCtl.new(page) + tab.setGeometry(x, y + 20, 300, 100) + + page1 = Qt::Widget.new(tab) + p1Lbl = Qt::Label.new("This is page 1", page1) + p1Lbl.setGeometry(20, 20, 100, 20) + page2 = Qt::Widget.new(tab) + p2Lbl = Qt::Label.new("This is page 2", page2) + p2Lbl.setGeometry(50, 20, 100, 20) + page3 = Qt::Widget.new(tab) + p3Lbl = Qt::Label.new("This is page 3", page3) + p3Lbl.setGeometry(20, 50, 100, 20) + + tab.addTab(page1, "Tab 1") + tab.addTab(page2, "Tab 2") + tab.addTab(page3, "Tab 3") + tab.show() + + x = 10 + y = 150 + + progLbl = Qt::Label.new("KProgress", page) + progLbl.setGeometry(x, y + 50, 95, 20) + progLbl.show() + + @p1 = KDE::Progress.new(page) + @p2 = KDE::Progress.new(15, page) + @p1.setTotalSteps(25) + @p2.setTotalSteps(25) + + @p1.setGeometry(x, y + 80, 125, 20) + @p2.setGeometry(x, y + 120, 125, 20) + + @p2.setPercentageVisible(false) + + @p1.show() + @p2.show() + + @total = 0 + + y = y + 150 + sepLbl = Qt::Label.new("KSeparator", page) + sepLbl.setGeometry(x, y, 95, 20) + sepLbl.show() + + sep = KDE::Separator.new(Qt::Frame::HLine, page) + sep.setGeometry(x, y + 20, 75, 10) + sep.show() + + page.show() + + @timer = Qt::Timer.new(page) + connect(@timer, SIGNAL('timeout()'), SLOT('add1()')) + @timer.start(100) + + add1() + end + + def add1() + @total = @total + 1 + @p1.advance(1) + @p2.advance(1) + + if @total == 26 + @timer.stop + end + end +end + +class Page8 + def initialize(parent) + page = parent.addPage() + + x = 40 + y = 10 + + dpLbl = Qt::Label.new("KDatePicker", page) + dpLbl.setGeometry(x, y, 95, 20) + dpLbl.show() + + dp = KDE::DatePicker.new(page) + dp.setGeometry(x, y + 20, 300, 170) + dp.show() + + y = y + 210 + + dtLbl = Qt::Label.new("KDateTable", page) + dtLbl.setGeometry(x, y, 95, 20) + dtLbl.show() + + dt = KDE::DateTable.new(page) + dt.setGeometry(x, y + 20, 300, 130) + dt.show() + end +end + +class PageThisApp + def initialize(parent) + page = parent.addPage() + + x = 10 + y = 10 + + taLbl = Qt::Label.new("This application uses KMainWindow as its top level widget\n and KListView in the"\ + " left-hand panel", page) + taLbl.setGeometry(x, y, 300, 60) + taLbl.show() + end +end + +class PageNotImpl + def initialize(parent) + page = parent.addPage() + + x = 10 + y = 10 + + niLbl = Qt::Label.new("Nothing is currently implemented for this widget", page) + niLbl.setGeometry(x, y, 300, 20) + niLbl.show() + end +end + +class CSDlg < KDE::Dialog + slots 'closeClicked()' + + def initialize(parent, name = "char select dlg", modal = false) + super(parent, name, modal) + + setGeometry(150, 50, 700, 320) + x = 10 + y = 10 + + csLbl = Qt::Label.new("KCharSelect", self) + csLbl.setGeometry(x, y, 95, 20) + csLbl.show() + cs = KDE::CharSelect.new(self, "chselect", nil, Qt::Char.new(0), 0) + cs.setGeometry(x, y + 20, 680, 250) + cs.show() + + closeBtn = Qt::PushButton.new("Close", self) + closeBtn.setGeometry( 610, 280, 60, 22) + closeBtn.show() + + connect(closeBtn, SIGNAL("clicked()"), SLOT('closeClicked()')) + end + + def closeClicked() + done(1) + end +end + +def UIWidgets.widKAnimWidget(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIWidgets.widKAuthIcon(parent) + parent.currentPageObj = Page5.new(parent) +end + +def UIWidgets.widKButtonBox(parent) + parent.currentPageObj = Page5.new(parent) +end + +def UIWidgets.widKCharSelect(parent) + dlg = CSDlg.new(parent) + dlg.show() +end + +def UIWidgets.widKColorButton(parent) + parent.currentPageObj = Page4.new(parent) +end + +def UIWidgets.widKColorCells(parent) + parent.currentPageObj = Page4.new(parent) +end + +def UIWidgets.widKColorCombo(parent) + parent.currentPageObj = Page2.new(parent) +end + +def UIWidgets.widKColorPatch(parent) + parent.currentPageObj = Page4.new(parent) +end + +def UIWidgets.widKComboBox(parent) + parent.currentPageObj = Page2.new(parent) +end + +def UIWidgets.widKCompletionBox(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIWidgets.widKContainerLayout(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIWidgets.widKCursor(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIWidgets.widKDatePicker(parent) + parent.currentPageObj = Page8.new(parent) +end + +def UIWidgets.widKDateTable(parent) + parent.currentPageObj = Page8.new(parent) +end + +def UIWidgets.widKDirectionButton(parent) + parent.currentPageObj = Page5.new(parent) +end + +def UIWidgets.widKDualColorButton(parent) + parent.currentPageObj = Page4.new(parent) +end + +def UIWidgets.widKTextEdit(parent) + parent.currentPageObj = Page1.new(parent) +end + +def UIWidgets.widKEditListBox(parent) + parent.currentPageObj = Page2.new(parent) +end + +def UIWidgets.widKFontChooser(parent) + parent.currentPageObj = Page3.new(parent) +end + +def UIWidgets.widKHSSelector(parent) + parent.currentPageObj = Page4.new(parent) +end + +def UIWidgets.widKIconView(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIWidgets.widKJanusWidget(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +#def UIWidgets.widKKeyButton(parent) +# parent.currentPageObj = Page5.new(parent) + +def UIWidgets.widKKeyChooser(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIWidgets.widKLed(parent) + parent.currentPageObj = Page6.new(parent) +end + +def UIWidgets.widKLineEdit(parent) + parent.currentPageObj = Page1.new(parent) +end + +def UIWidgets.widKListBox(parent) + parent.currentPageObj = Page2.new(parent) +end + +def UIWidgets.widKListView(parent) + parent.currentPageObj = PageThisApp.new(parent) +end + +def UIWidgets.widKNumInput(parent) + parent.currentPageObj = Page1.new(parent) +end + +def UIWidgets.widKPaletteTable(parent) + parent.currentPageObj = Page4.new(parent) +end + +def UIWidgets.widKPasswordEdit(parent) + parent.currentPageObj = Page5.new(parent) +end + +def UIWidgets.widKProgress(parent) + parent.currentPageObj = Page7.new(parent) +end + +def UIWidgets.widKRootPixmap(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIWidgets.widKMainWindow(parent) + parent.currentPageObj = PageThisApp.new(parent) +end + +def UIWidgets.widKRestrictedLine(parent) + parent.currentPageObj = Page1.new(parent) +end + +def UIWidgets.widKRuler(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIWidgets.widKSelector(parent) + parent.currentPageObj = Page4.new(parent) +end + +def UIWidgets.widKSeparator(parent) + parent.currentPageObj = Page7.new(parent) +end + +def UIWidgets.widKSqueezedTextLabel(parent) + parent.currentPageObj = Page1.new(parent) +end + +def UIWidgets.widKTabButton(parent) + parent.currentPageObj = Page5.new(parent) +end + +def UIWidgets.widKTabCtl(parent) + parent.currentPageObj = Page7.new(parent) +end + +def UIWidgets.widKTextBrowser(parent) + parent.currentPageObj = PageNotImpl.new(parent) +end + +def UIWidgets.widKURLLabel(parent) + parent.currentPageObj = Page5.new(parent) +end + + +if $0 == __FILE__ + puts + puts "Please run uisampler.rb" + puts +end + +end diff --git a/korundum/rubylib/examples/uimodules/uixml.rb b/korundum/rubylib/examples/uimodules/uixml.rb new file mode 100644 index 00000000..67be21ac --- /dev/null +++ b/korundum/rubylib/examples/uimodules/uixml.rb @@ -0,0 +1,56 @@ +=begin +This is a ruby version of Jim Bublitz's pykde program, translated by Richard Dale +=end + +require 'Korundum' + +module UIXML + +class PageLaunch + def initialize(parent) + page = parent.addPage() + + x = 10 + y = 10 + + launchLbl = Qt::Label.new("Launching application ... please wait\n\nClose launched application to continue", page) + launchLbl.setGeometry(x, y, 300, 80) + launchLbl.show() + + page.show() + + $kapp.processEvents() + end +end + +def UIXML.xmlKActionCollection(parent) + parent.currentPageObj = PageLaunch.new(parent) + system("ruby xmlmenudemo.rb") +end + +def UIXML.xmlKEditToolbar(parent) + parent.currentPageObj = PageLaunch.new(parent) + system("ruby xmlmenudemo.rb") +end + +def UIXML.xmlKEditToolbarWidget(parent) + parent.currentPageObj = PageLaunch.new(parent) + system("ruby xmlmenudemo.rb") +end + +def UIXML.xmlKXMLGUIBuilder(parent) + parent.currentPageObj = PageLaunch.new(parent) + system("ruby xmlmenudemo.rb") +end + +def UIXML.xmlKXMLGUIClient(parent) + parent.currentPageObj = PageLaunch.new(parent) + system("ruby xmlmenudemo.rb") +end + +def UIXML.xmlKXMLGUIFactory(parent) + parent.currentPageObj = PageLaunch.new(parent) + system("ruby xmlmenudemo.rb") +end + +end |