diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 90825e2392b2d70e43c7a25b8a3752299a933894 (patch) | |
tree | e33aa27f02b74604afbfd0ea4f1cfca8833d882a /korundum/rubylib/examples/uimodules/uimenus.rb | |
download | tdebindings-90825e2392b2d70e43c7a25b8a3752299a933894.tar.gz tdebindings-90825e2392b2d70e43c7a25b8a3752299a933894.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'korundum/rubylib/examples/uimodules/uimenus.rb')
-rw-r--r-- | korundum/rubylib/examples/uimodules/uimenus.rb | 137 |
1 files changed, 137 insertions, 0 deletions
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 + |