WxVanaClock 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +3 -0
- data/LICENSE +19 -0
- data/Manifest +7 -0
- data/README +0 -0
- data/WxVanaClock.gemspec +48 -0
- data/bin/WxVanaClock +6 -0
- data/lib/wx_vana_clock.rb +77 -0
- data/lib/wxvc-xrc.xml +164 -0
- metadata +70 -0
data/CHANGELOG
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2007 Travis Tilley
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
data/Manifest
ADDED
data/README
ADDED
File without changes
|
data/WxVanaClock.gemspec
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
|
2
|
+
# Gem::Specification for Wxvanaclock-1.0.0
|
3
|
+
# Originally generated by Echoe
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = %q{WxVanaClock}
|
7
|
+
s.version = "1.0.0"
|
8
|
+
s.date = %q{2007-09-04}
|
9
|
+
s.summary = %q{WxVanaClock is a clock for Final Fantasy Online written using wxWidgets.}
|
10
|
+
s.email = %q{ttilley@gmail.com}
|
11
|
+
s.homepage = %q{http://vanatime.rubyforge.org/}
|
12
|
+
s.rubyforge_project = %q{vanatime}
|
13
|
+
s.description = %q{WxVanaClock is a clock for Final Fantasy Online written using wxWidgets.}
|
14
|
+
s.default_executable = %q{WxVanaClock}
|
15
|
+
s.has_rdoc = true
|
16
|
+
s.authors = ["Travis Tilley"]
|
17
|
+
s.files = ["README", "Manifest", "LICENSE", "lib/wxvc-xrc.xml", "lib/wx_vana_clock.rb", "CHANGELOG", "bin/WxVanaClock", "WxVanaClock.gemspec"]
|
18
|
+
s.executables = ["WxVanaClock"]
|
19
|
+
s.add_dependency(%q<VanaTime>, [">= 1.2.1"])
|
20
|
+
s.add_dependency(%q<wxruby>, [">= 1.9.0"])
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
# # Original Rakefile source (requires the Echoe gem):
|
25
|
+
#
|
26
|
+
# version = "1.0.0"
|
27
|
+
#
|
28
|
+
# ENV['RUBY_FLAGS'] = ""
|
29
|
+
#
|
30
|
+
# begin
|
31
|
+
# require 'rubygems'
|
32
|
+
# gem 'echoe', '=2.3'
|
33
|
+
# require 'echoe'
|
34
|
+
#
|
35
|
+
# Echoe.new('WxVanaClock', version) do |p|
|
36
|
+
# p.rubyforge_name = 'vanatime'
|
37
|
+
# p.summary = "WxVanaClock is a clock for Final Fantasy Online " +
|
38
|
+
# "written using wxWidgets."
|
39
|
+
# p.url = "http://vanatime.rubyforge.org/"
|
40
|
+
# p.author = 'Travis Tilley'
|
41
|
+
# p.email = "ttilley@gmail.com"
|
42
|
+
# p.dependencies = ["VanaTime >=1.2.1", "wxruby >=1.9.0"]
|
43
|
+
# end
|
44
|
+
#
|
45
|
+
# rescue LoadError => boom
|
46
|
+
# puts "You are missing a dependency required for meta-operations on this gem."
|
47
|
+
# puts "#{boom.to_s.capitalize}."
|
48
|
+
# end
|
data/bin/WxVanaClock
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
gem 'VanaTime', '>=1.2.1'
|
2
|
+
require 'vana_time'
|
3
|
+
gem 'wxruby', '>=1.9.0'
|
4
|
+
require 'wx'
|
5
|
+
|
6
|
+
module WxVanaClock
|
7
|
+
class ClockFrame < Wx::Frame
|
8
|
+
def initialize(parent)
|
9
|
+
super()
|
10
|
+
$xrc.load_frame_subclass(self, nil, 'ClockFrame')
|
11
|
+
|
12
|
+
@parent = parent
|
13
|
+
|
14
|
+
# get all the text controls
|
15
|
+
@vana_day =
|
16
|
+
Wx::Window.find_window_by_id(Wx::xrcid('VanaDay'), self)
|
17
|
+
@vana_time =
|
18
|
+
Wx::Window.find_window_by_id(Wx::xrcid('VanaTime'), self)
|
19
|
+
@earth_time =
|
20
|
+
Wx::Window.find_window_by_id(Wx::xrcid('EarthTime'), self)
|
21
|
+
@moon_percent =
|
22
|
+
Wx::Window.find_window_by_id(Wx::xrcid('MoonPercent'), self)
|
23
|
+
@phase_name =
|
24
|
+
Wx::Window.find_window_by_id(Wx::xrcid('PhaseName'), self)
|
25
|
+
@next_phase_countdown =
|
26
|
+
Wx::Window.find_window_by_id(Wx::xrcid('NextPhaseCountdown'), self)
|
27
|
+
@next_phase_name =
|
28
|
+
Wx::Window.find_window_by_id(Wx::xrcid('NextPhaseName'), self)
|
29
|
+
@optimal_phase_countdown =
|
30
|
+
Wx::Window.find_window_by_id(Wx::xrcid('OptimalPhaseCountdown'), self)
|
31
|
+
@optimal_phase_name =
|
32
|
+
Wx::Window.find_window_by_id(Wx::xrcid('OptimalPhaseName'), self)
|
33
|
+
|
34
|
+
# create timer object, give it ID of 9000 and set owner to self
|
35
|
+
@timer = Wx::Timer.new(self, 9000)
|
36
|
+
# register the timer as an event
|
37
|
+
evt_timer(9000) {|event| notify(event)}
|
38
|
+
# set the timer to fire off every 35 milliseconds
|
39
|
+
@timer.start(35)
|
40
|
+
end
|
41
|
+
|
42
|
+
def notify(event)
|
43
|
+
vt = @parent.vana_time
|
44
|
+
vt.earth_time = Time.now
|
45
|
+
|
46
|
+
@vana_day.change_value vt.day.to_s
|
47
|
+
@vana_time.change_value vt.to_s
|
48
|
+
@earth_time.change_value vt.earth_time.to_s
|
49
|
+
@moon_percent.change_value vt.moon.percent
|
50
|
+
@phase_name.change_value vt.moon.phase
|
51
|
+
@next_phase_countdown.change_value vt.moon.to_next
|
52
|
+
@next_phase_name.change_value vt.moon.next_phase
|
53
|
+
@optimal_phase_countdown.change_value vt.moon.to_optimal
|
54
|
+
@optimal_phase_name.change_value vt.moon.optimal_phase
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
class ClockApp < Wx::App
|
59
|
+
attr_accessor :vana_time
|
60
|
+
|
61
|
+
def on_init
|
62
|
+
# create a resource handler
|
63
|
+
$xrc = Wx::XmlResource.get()
|
64
|
+
$xrc.init_all_handlers()
|
65
|
+
|
66
|
+
# load resource file
|
67
|
+
xrc_file = File.join(File.dirname(__FILE__), 'wxvc-xrc.xml')
|
68
|
+
$xrc.load(xrc_file)
|
69
|
+
|
70
|
+
@vana_time = FFXI::VanaTime.now
|
71
|
+
|
72
|
+
# show the main frame
|
73
|
+
@clock = ClockFrame.new(self)
|
74
|
+
@clock.show(true)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
data/lib/wxvc-xrc.xml
ADDED
@@ -0,0 +1,164 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<resource>
|
3
|
+
<object class="wxFrame" name="ClockFrame">
|
4
|
+
<title>VanaClock</title>
|
5
|
+
<style>wxCLOSE_BOX</style>
|
6
|
+
<object class="wxBoxSizer">
|
7
|
+
<orient>wxVERTICAL</orient>
|
8
|
+
<object class="sizeritem">
|
9
|
+
<object class="wxBoxSizer">
|
10
|
+
<orient>wxHORIZONTAL</orient>
|
11
|
+
<object class="sizeritem">
|
12
|
+
<object class="wxStaticText" name="VanaTimeLabel">
|
13
|
+
<label>Vana'diel Time: </label>
|
14
|
+
<size>110, 20</size>
|
15
|
+
</object>
|
16
|
+
<option>0</option>
|
17
|
+
<minsize>110, 20</minsize>
|
18
|
+
</object>
|
19
|
+
<object class="sizeritem">
|
20
|
+
<object class="wxTextCtrl" name="VanaDay">
|
21
|
+
<value>Watersday</value>
|
22
|
+
<size>94, 22</size>
|
23
|
+
<style>wxTE_READONLY</style>
|
24
|
+
</object>
|
25
|
+
<option>0</option>
|
26
|
+
<minsize>94, 22</minsize>
|
27
|
+
</object>
|
28
|
+
<object class="sizeritem">
|
29
|
+
<object class="wxTextCtrl" name="VanaTime">
|
30
|
+
<value>1029-11-23 12:20:04</value>
|
31
|
+
<size>150, 22</size>
|
32
|
+
<style>wxTE_READONLY</style>
|
33
|
+
</object>
|
34
|
+
<option>1</option>
|
35
|
+
<flag>wxGROW</flag>
|
36
|
+
<minsize>150, 22</minsize>
|
37
|
+
</object>
|
38
|
+
</object>
|
39
|
+
<flag>wxGROW</flag>
|
40
|
+
</object>
|
41
|
+
<object class="sizeritem">
|
42
|
+
<object class="wxBoxSizer">
|
43
|
+
<orient>wxHORIZONTAL</orient>
|
44
|
+
<object class="sizeritem">
|
45
|
+
<object class="wxStaticText" name="EarthTimeLabel">
|
46
|
+
<label>Earth Time: </label>
|
47
|
+
<size>110, 20</size>
|
48
|
+
</object>
|
49
|
+
<option>0</option>
|
50
|
+
<minsize>110, 20</minsize>
|
51
|
+
</object>
|
52
|
+
<object class="sizeritem">
|
53
|
+
<object class="wxTextCtrl" name="EarthTime">
|
54
|
+
<value>Mon Sep 03 13:24:48 EDT 2007</value>
|
55
|
+
<style>wxTE_READONLY</style>
|
56
|
+
</object>
|
57
|
+
<option>1</option>
|
58
|
+
<flag>wxGROW</flag>
|
59
|
+
</object>
|
60
|
+
</object>
|
61
|
+
<flag>wxGROW</flag>
|
62
|
+
</object>
|
63
|
+
<object class="sizeritem">
|
64
|
+
<object class="wxBoxSizer">
|
65
|
+
<orient>wxHORIZONTAL</orient>
|
66
|
+
<object class="sizeritem">
|
67
|
+
<object class="wxStaticText" name="MoonPhaseLabel">
|
68
|
+
<label>Moon Phase: </label>
|
69
|
+
<size>110, 20</size>
|
70
|
+
</object>
|
71
|
+
<option>0</option>
|
72
|
+
<minsize>110, 20</minsize>
|
73
|
+
</object>
|
74
|
+
<object class="sizeritem">
|
75
|
+
<object class="wxTextCtrl" name="MoonPercent">
|
76
|
+
<value>71%</value>
|
77
|
+
<size>42, 20</size>
|
78
|
+
<style>wxTE_READONLY|wxTE_RIGHT</style>
|
79
|
+
</object>
|
80
|
+
<option>0</option>
|
81
|
+
<minsize>42, 20</minsize>
|
82
|
+
</object>
|
83
|
+
<object class="sizeritem">
|
84
|
+
<object class="wxTextCtrl" name="PhaseName">
|
85
|
+
<value>Waning Gibbous</value>
|
86
|
+
<size>202, 22</size>
|
87
|
+
<style>wxTE_READONLY</style>
|
88
|
+
</object>
|
89
|
+
<option>1</option>
|
90
|
+
<flag>wxGROW</flag>
|
91
|
+
<minsize>202, 22</minsize>
|
92
|
+
</object>
|
93
|
+
</object>
|
94
|
+
<flag>wxGROW</flag>
|
95
|
+
</object>
|
96
|
+
<object class="sizeritem">
|
97
|
+
<object class="wxBoxSizer">
|
98
|
+
<orient>wxHORIZONTAL</orient>
|
99
|
+
<object class="sizeritem">
|
100
|
+
<object class="wxStaticText" name="NextPhaseLabel">
|
101
|
+
<label>Next Phase: </label>
|
102
|
+
<size>110, 20</size>
|
103
|
+
</object>
|
104
|
+
<option>0</option>
|
105
|
+
<minsize>110, 20</minsize>
|
106
|
+
</object>
|
107
|
+
<object class="sizeritem">
|
108
|
+
<object class="wxTextCtrl" name="NextPhaseCountdown">
|
109
|
+
<value>04:18:23</value>
|
110
|
+
<size>86, 22</size>
|
111
|
+
<style>wxTE_READONLY|wxTE_RIGHT</style>
|
112
|
+
</object>
|
113
|
+
<option>0</option>
|
114
|
+
<minsize>86, 22</minsize>
|
115
|
+
</object>
|
116
|
+
<object class="sizeritem">
|
117
|
+
<object class="wxTextCtrl" name="NextPhaseName">
|
118
|
+
<value>Last Quarter</value>
|
119
|
+
<size>158, 22</size>
|
120
|
+
<style>wxTE_READONLY</style>
|
121
|
+
</object>
|
122
|
+
<option>1</option>
|
123
|
+
<flag>wxGROW</flag>
|
124
|
+
<minsize>158, 22</minsize>
|
125
|
+
</object>
|
126
|
+
</object>
|
127
|
+
<flag>wxGROW</flag>
|
128
|
+
</object>
|
129
|
+
<object class="sizeritem">
|
130
|
+
<object class="wxBoxSizer">
|
131
|
+
<orient>wxHORIZONTAL</orient>
|
132
|
+
<object class="sizeritem">
|
133
|
+
<object class="wxStaticText" name="OptimalPhaseLabel">
|
134
|
+
<label>Optimal Phase: </label>
|
135
|
+
<size>110, 20</size>
|
136
|
+
</object>
|
137
|
+
<option>0</option>
|
138
|
+
<minsize>110, 20</minsize>
|
139
|
+
</object>
|
140
|
+
<object class="sizeritem">
|
141
|
+
<object class="wxTextCtrl" name="OptimalPhaseCountdown">
|
142
|
+
<value>01:27:59</value>
|
143
|
+
<size>86, 22</size>
|
144
|
+
<style>wxTE_READONLY|wxTE_RIGHT</style>
|
145
|
+
</object>
|
146
|
+
<option>0</option>
|
147
|
+
<minsize>86, 22</minsize>
|
148
|
+
</object>
|
149
|
+
<object class="sizeritem">
|
150
|
+
<object class="wxTextCtrl" name="OptimalPhaseName">
|
151
|
+
<value>New Moon</value>
|
152
|
+
<size>158, 22</size>
|
153
|
+
<style>wxTE_READONLY</style>
|
154
|
+
</object>
|
155
|
+
<option>1</option>
|
156
|
+
<flag>wxGROW</flag>
|
157
|
+
<minsize>158, 22</minsize>
|
158
|
+
</object>
|
159
|
+
</object>
|
160
|
+
<flag>wxGROW</flag>
|
161
|
+
</object>
|
162
|
+
</object>
|
163
|
+
</object>
|
164
|
+
</resource>
|
metadata
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.9.4
|
3
|
+
specification_version: 1
|
4
|
+
name: WxVanaClock
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: 1.0.0
|
7
|
+
date: 2007-09-04 00:00:00 -04:00
|
8
|
+
summary: WxVanaClock is a clock for Final Fantasy Online written using wxWidgets.
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
email: ttilley@gmail.com
|
12
|
+
homepage: http://vanatime.rubyforge.org/
|
13
|
+
rubyforge_project: vanatime
|
14
|
+
description: WxVanaClock is a clock for Final Fantasy Online written using wxWidgets.
|
15
|
+
autorequire:
|
16
|
+
default_executable:
|
17
|
+
bindir: bin
|
18
|
+
has_rdoc: true
|
19
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.0
|
24
|
+
version:
|
25
|
+
platform: ruby
|
26
|
+
signing_key:
|
27
|
+
cert_chain:
|
28
|
+
post_install_message:
|
29
|
+
authors:
|
30
|
+
- Travis Tilley
|
31
|
+
files:
|
32
|
+
- README
|
33
|
+
- Manifest
|
34
|
+
- LICENSE
|
35
|
+
- lib/wxvc-xrc.xml
|
36
|
+
- lib/wx_vana_clock.rb
|
37
|
+
- CHANGELOG
|
38
|
+
- bin/WxVanaClock
|
39
|
+
- WxVanaClock.gemspec
|
40
|
+
test_files: []
|
41
|
+
|
42
|
+
rdoc_options: []
|
43
|
+
|
44
|
+
extra_rdoc_files: []
|
45
|
+
|
46
|
+
executables:
|
47
|
+
- WxVanaClock
|
48
|
+
extensions: []
|
49
|
+
|
50
|
+
requirements: []
|
51
|
+
|
52
|
+
dependencies:
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: VanaTime
|
55
|
+
version_requirement:
|
56
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 1.2.1
|
61
|
+
version:
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: wxruby
|
64
|
+
version_requirement:
|
65
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 1.9.0
|
70
|
+
version:
|