You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdebindings/korundum/rubylib/examples/uimodules/uimenus.rb

138 lines
2.7 KiB

=begin
This is a ruby version of Jim Bublitz's pytde program, translated by Richard Dale
=end
require 'Korundum'
module UIMenus
class PageLaunch
def initialize(parent)
page = parent.addPage()
x = 10
y = 10
launchLbl = TQt::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 = TQt::Label.new("Nothing is currently implemented for this widget", page)
niLbl.setGeometry(x, y, 300, 20)
niLbl.show()
end
end
def UIMenus.menuTDEAccelGen(parent)
parent.currentPageObj = PageNotImpl.new(parent)
end
def UIMenus.menuTDEAccelMenu(parent)
parent.currentPageObj = PageNotImpl.new(parent)
end
def UIMenus.menuTDEAction(parent)
parent.currentPageObj = PageLaunch.new(parent)
system("ruby menudemo.rb")
end
def UIMenus.menuTDEActionMenu(parent)
parent.currentPageObj = PageLaunch.new(parent)
system("ruby menudemo.rb")
end
def UIMenus.menuTDEActionSeparator(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.menuTDEPopupFrame(parent)
# pass
end
def UIMenus.menuTDEPopupMenu(parent)
# pass
end
def UIMenus.menuTDEPopupTitle(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.menuTDEToolBar(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