diff options
Diffstat (limited to 'korundum/rubylib/examples/uimodules/uimisc.rb')
-rw-r--r-- | korundum/rubylib/examples/uimodules/uimisc.rb | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/korundum/rubylib/examples/uimodules/uimisc.rb b/korundum/rubylib/examples/uimodules/uimisc.rb index b5d10fc1..dad78f5d 100644 --- a/korundum/rubylib/examples/uimodules/uimisc.rb +++ b/korundum/rubylib/examples/uimodules/uimisc.rb @@ -2,11 +2,11 @@ This is a ruby version of Jim Bublitz's pytde program, translated by Richard Dale =end -require 'Korundum' +retquire 'Korundum' module UIMisc -class Page3 < Qt::Object +class Page3 < TQt::Object slots 'ivChanged()', 'fvChanged()', 'dvChanged()' def initialize(parent) @@ -15,33 +15,33 @@ class Page3 < Qt::Object 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) + green = TQt::Color.new(0, 255, 0) + yellow = TQt::Color.new(255, 255, 0) + red = TQt::Color.new(255, 0, 0) - ivLbl = Qt::Label.new("KIntValidator", page) + ivLbl = TQt::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()')) + connect(@iv, SIGNAL("textChanged(const TQString&)"), SLOT('ivChanged()')) @ivVal = KDE::IntValidator.new(page) @ivVal.setRange(20, 50) - ivRngLbl = Qt::Label.new("Range is 20 - 50", page) + ivRngLbl = TQt::Label.new("Range is 20 - 50", page) ivRngLbl.setGeometry(x, y + 45, 100, 20) ivRngLbl.show() - ivAccLbl = Qt::Label.new("Acceptable", page) + ivAccLbl = TQt::Label.new("Acceptable", page) ivAccLbl.setGeometry(x + 125, y + 45, 85, 20) ivAccLbl.show() - ivInterLbl = Qt::Label.new("Intermediate", page) + ivInterLbl = TQt::Label.new("Intermediate", page) ivInterLbl.setGeometry(x + 125, y + 20, 85, 20) ivInterLbl.show() - ivInvalLbl = Qt::Label.new("Invalid", page) + ivInvalLbl = TQt::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) @@ -56,29 +56,29 @@ class Page3 < Qt::Object y = y + 100 - fvLbl = Qt::Label.new("KDoubleValidator", page) + fvLbl = TQt::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()')) + connect(@fv, SIGNAL("textChanged(const TQString&)"), 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 = TQt::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 = TQt::Label.new("Acceptable", page) fvAccLbl.setGeometry(x + 125, y + 45, 85, 20) fvAccLbl.show() - fvInterLbl = Qt::Label.new("Intermediate", page) + fvInterLbl = TQt::Label.new("Intermediate", page) fvInterLbl.setGeometry(x + 125, y + 20, 95, 20) fvInterLbl.show() - fvInvalLbl = Qt::Label.new("Invalid", page) + fvInvalLbl = TQt::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) @@ -93,38 +93,38 @@ class Page3 < Qt::Object y = y + 100 - dvLbl = Qt::Label.new("KDateValidator", page) + dvLbl = TQt::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()')) +# connect(dv, SIGNAL("textChanged(const TQString&)"), 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 = TQt::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 = TQt::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 = TQt::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 = TQt::Label.new("Acceptable", page) dvAccLbl.setGeometry(x + 125, y + 45, 85, 20) dvAccLbl.show() - dvInterLbl = Qt::Label.new("Intermediate", page) + dvInterLbl = TQt::Label.new("Intermediate", page) dvInterLbl.setGeometry(x + 125, y + 20, 85, 20) dvInterLbl.show() - dvInvalLbl = Qt::Label.new("Invalid", page) + dvInvalLbl = TQt::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) @@ -143,12 +143,12 @@ class Page3 < Qt::Object @ivInterLed.off() @ivAccLed.off() - i = Qt::Integer.new(0) + i = TQt::Integer.new(0) state = @ivVal.validate(@iv.text(), i) - if state == Qt::Validator::Acceptable + if state == TQt::Validator::Acceptable @ivAccLed.on() - elsif state == Qt::Validator::Intermediate + elsif state == TQt::Validator::Intermediate @ivInterLed.on() else @ivInvalLed.on() @@ -160,12 +160,12 @@ class Page3 < Qt::Object @fvInterLed.off() @fvAccLed.off() - i = Qt::Integer.new(0) + i = TQt::Integer.new(0) state = @fvVal.validate(@fv.text(), i) - if state == Qt::Validator::Acceptable + if state == TQt::Validator::Acceptable @fvAccLed.on() - elsif state == Qt::Validator::Intermediate + elsif state == TQt::Validator::Intermediate @fvInterLed.on() else @fvInvalLed.on() @@ -177,12 +177,12 @@ class Page3 < Qt::Object @dvInterLed.off() @dvAccLed.off() - i = Qt::Integer.new(0) + i = TQt::Integer.new(0) state = @dvVal.validate(@dv.text(), i) - if state == Qt::Validator::Acceptable + if state == TQt::Validator::Acceptable @dvAccLed.on() - elsif state == Qt::Validator::Intermediate + elsif state == TQt::Validator::Intermediate @dvInterLed.on() else @dvInvalLed.on() @@ -197,7 +197,7 @@ class PageNotImpl x = 10 y = 10 - niLbl = Qt::Label.new("Nothing is currently implemented for this widget", page) + niLbl = TQt::Label.new("Nothing is currently implemented for this widget", page) niLbl.setGeometry(x, y, 300, 20) niLbl.show() end @@ -259,7 +259,7 @@ def UIMisc.miscKThemeBase(parent) parent.currentPageObj = PageNotImpl.new(parent) end -def UIMisc.miscQXEmbed(parent) +def UIMisc.miscTQXEmbed(parent) parent.currentPageObj = PageNotImpl.new(parent) end |