summaryrefslogtreecommitdiffstats
path: root/korundum/rubylib/examples/uisampler.rb
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-05 15:55:57 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-05 15:55:57 -0600
commit9ba04742771370f59740e32e11c5f3a1e6a1b70a (patch)
treec81c34dae2b3b1ea73801bf18a960265dc4207f7 /korundum/rubylib/examples/uisampler.rb
parent1a96c45b22d01378202d9dc7ed9c47acd30f966e (diff)
downloadtdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.tar.gz
tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.zip
Initial TQt conversion
Diffstat (limited to 'korundum/rubylib/examples/uisampler.rb')
-rw-r--r--korundum/rubylib/examples/uisampler.rb50
1 files changed, 25 insertions, 25 deletions
diff --git a/korundum/rubylib/examples/uisampler.rb b/korundum/rubylib/examples/uisampler.rb
index 24df8e3e..d1b619b9 100644
--- a/korundum/rubylib/examples/uisampler.rb
+++ b/korundum/rubylib/examples/uisampler.rb
@@ -2,13 +2,13 @@
This is a ruby version of Jim Bublitz's pytde program, translated by Richard Dale
=end
-require 'Korundum'
+retquire 'Korundum'
-require 'uimodules/uiwidgets.rb'
-require 'uimodules/uidialogs.rb'
-require 'uimodules/uimenus.rb'
-require 'uimodules/uimisc.rb'
-require 'uimodules/uixml.rb'
+retquire 'uimodules/uiwidgets.rb'
+retquire 'uimodules/uidialogs.rb'
+retquire 'uimodules/uimenus.rb'
+retquire 'uimodules/uimisc.rb'
+retquire 'uimodules/uixml.rb'
$listItems = {"Dialogs" =>
{"KDE::AboutDialog" => ["KDE::AboutApplication", "KDE::AboutContainer", "KDE::ImageTrackLabel",
@@ -112,7 +112,7 @@ $listItems = {"Dialogs" =>
"KDE::SharedPixmap" => [],
"KDE::SystemTray" => [],
"KDE::ThemeBase" => ["KDE::ThemeCache", "KDE::ThemePixmap", "KDE::ThemeStyle"],
- "QXEmbed" => []}}
+ "TQXEmbed" => []}}
BLANK_MSG = <<END_OF_STRING
<b>UISampler</b> - provides examples of <b>Korundum</b> widgets<p>
@@ -123,7 +123,7 @@ END_OF_STRING
class MainWin < KDE::MainWindow
TREE_WIDTH = 220
- slots 'lvClicked(QListViewItem*)'
+ slots 'lvClicked(TQListViewItem*)'
attr_accessor :edit, :currentPageObj
@@ -132,27 +132,27 @@ class MainWin < KDE::MainWindow
setCaption("Samples of Korundum widget usage")
# The following leave about 375 x 390 for the rt hand panel
- mainGeom = Qt::Rect.new(0, 0, 640, 500)
+ mainGeom = TQt::Rect.new(0, 0, 640, 500)
setGeometry(mainGeom)
# create the main view - list view on the left and an
# area to display frames on the right
- @mainView = Qt::Splitter.new(self, "main view")
+ @mainView = TQt::Splitter.new(self, "main view")
@tree = KDE::ListView.new(@mainView, "tree")
- @page = Qt::WidgetStack.new(@mainView, "page")
- blankPage = Qt::Widget.new(@page, "blank")
+ @page = TQt::WidgetStack.new(@mainView, "page")
+ blankPage = TQt::Widget.new(@page, "blank")
blankPage.setGeometry(0, 0, 375, 390)
- blankPage.setBackgroundMode(Qt::Widget::PaletteBase)
+ blankPage.setBackgroundMode(TQt::Widget::PaletteBase)
- blankLbl = Qt::Label.new(BLANK_MSG, blankPage)
+ blankLbl = TQt::Label.new(BLANK_MSG, blankPage)
blankLbl.setGeometry(40, 10, 380, 150)
- blankLbl.setBackgroundMode(Qt::Widget::PaletteBase)
+ blankLbl.setBackgroundMode(TQt::Widget::PaletteBase)
- blankPM = Qt::Pixmap.new("rbtestimage.png")
- pmLbl = Qt::Label.new("", blankPage)
+ blankPM = TQt::Pixmap.new("rbtestimage.png")
+ pmLbl = TQt::Label.new("", blankPage)
pmLbl.setPixmap(blankPM)
pmLbl.setGeometry(40, 160, 300, 200)
- pmLbl.setBackgroundMode(Qt::Widget::PaletteBase)
+ pmLbl.setBackgroundMode(TQt::Widget::PaletteBase)
@page.addWidget(blankPage, 1)
@page.raiseWidget(1)
@@ -160,7 +160,7 @@ class MainWin < KDE::MainWindow
setCentralWidget(@mainView)
initListView()
- connect(@tree, SIGNAL("clicked(QListViewItem*)"), self, SLOT('lvClicked(QListViewItem*)'))
+ connect(@tree, SIGNAL("clicked(TQListViewItem*)"), self, SLOT('lvClicked(TQListViewItem*)'))
@edit = nil
@currentPageObj = nil
@@ -173,15 +173,15 @@ class MainWin < KDE::MainWindow
# tree.setMaximumWidth(treeWidth)
@mainView.setSizes([TREE_WIDTH, 375])
@tree.setRootIsDecorated(true)
- @tree.setVScrollBarMode(Qt::ScrollView::AlwaysOn)
+ @tree.setVScrollBarMode(TQt::ScrollView::AlwaysOn)
topLevel = $listItems.keys()
topLevel.each do |item_1|
- parent = Qt::ListViewItem.new(@tree, String.new(item_1))
+ parent = TQt::ListViewItem.new(@tree, String.new(item_1))
secondLevel = $listItems[item_1].keys()
secondLevel.each do |item_2|
- child = Qt::ListViewItem.new(parent, String.new(item_2))
+ child = TQt::ListViewItem.new(parent, String.new(item_2))
$listItems[item_1][item_2].each do |item_3|
- Qt::ListViewItem.new(child, String.new(item_3))
+ TQt::ListViewItem.new(child, String.new(item_3))
end
end
end
@@ -216,9 +216,9 @@ class MainWin < KDE::MainWindow
current.dispose
end
- newPage = Qt::Widget.new(@page)
+ newPage = TQt::Widget.new(@page)
newPage.setGeometry(0, 0, 375, 390)
-# newPage.setBackgroundMode(QWidget.PaletteBase)
+# newPage.setBackgroundMode(TQWidget.PaletteBase)
@page.addWidget(newPage, 2)
@page.raiseWidget(2)