summaryrefslogtreecommitdiffstats
path: root/korundum/rubylib/examples/uimodules/uimenus.rb
blob: 4a8ff5234a288f1f0687a05aad3bb43af3276a11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
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