rbcurse 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,16 @@
1
+ ** 2009-02-22 20:48 **
2
+
3
+ ## Released 0.1.2 ##
4
+
5
+ - search in textview with wrap, case insensitive, highlighting searched text
6
+ - table can have nil data
7
+ - tabbed pane has ok_cancel button, ok by default
8
+ - table autosizing - required for adhoc queries
9
+ - table horizontal scrolling
10
+ - editing when more columns than viewable in table
11
+ - confirm dialog, normal mnemonics for buttons
12
+
13
+ * * *
1
14
  ** 2009-02-17 12:10 **
2
15
  ## added table markers for data and columns before and after on border ##
3
16
 
data/History.txt CHANGED
@@ -1,3 +1,15 @@
1
+ === 0.1.2 / 2009-02-22
2
+
3
+ * Minor enhancements
4
+
5
+ * search in textview with wrap, case insensitive, highlighting searched text
6
+ * table can have nil data
7
+ * tabbed pane has ok_cancel button, ok by default
8
+ * table autosizing - required for adhoc queries
9
+ * table horizontal scrolling
10
+ * editing when more columns than viewable in table
11
+ * confirm dialog, normal mnemonics for buttons
12
+
1
13
  === 0.1.1 / 2009-02-12
2
14
 
3
15
  * Bugfix
data/Manifest.txt CHANGED
@@ -1,10 +1,25 @@
1
+ CHANGELOG
1
2
  History.txt
2
3
  Manifest.txt
3
4
  README.txt
4
- CHANGELOG
5
5
  Rakefile
6
+ examples/qdfilechooser.rb
7
+ examples/rfe.rb
8
+ examples/rfe_renderer.rb
9
+ examples/sqlc.rb
10
+ examples/test1.rb
11
+ examples/test2.rb
12
+ examples/testcombo.rb
13
+ examples/testd.db
14
+ examples/testkeypress.rb
15
+ examples/testmenu.rb
16
+ examples/testtable.rb
17
+ examples/testtabp.rb
18
+ examples/testtodo.rb
19
+ examples/todocsv.csv
20
+ examples/viewtodo.rb
21
+ lib/rbcurse.rb
6
22
  lib/rbcurse.rb
7
- test/test_rbcurse.rb
8
23
  lib/rbcurse/action.rb
9
24
  lib/rbcurse/applicationheader.rb
10
25
  lib/rbcurse/celleditor.rb
@@ -35,23 +50,9 @@ lib/rbcurse/scrollable.rb
35
50
  lib/rbcurse/selectable.rb
36
51
  lib/rbcurse/table/tablecellrenderer.rb
37
52
  lib/rbcurse/table/tabledatecellrenderer.rb
38
- lib/rbcurse.rb
39
53
  lib/ver/keyboard.rb
40
54
  lib/ver/keyboard2.rb
41
55
  lib/ver/ncurses.rb
42
56
  lib/ver/window.rb
43
- examples/qdfilechooser.rb
44
- examples/rfe.rb
45
- examples/rfe_renderer.rb
46
- examples/sqlc.rb
47
- examples/test1.rb
48
- examples/test2.rb
49
- examples/testcombo.rb
50
- examples/testd.db
51
- examples/testkeypress.rb
52
- examples/testmenu.rb
53
- examples/testtable.rb
54
- examples/testtabp.rb
55
- examples/testtodo.rb
56
- examples/todocsv.csv
57
- examples/viewtodo.rb
57
+ test/test_rbcurse.rb
58
+
data/README.txt CHANGED
@@ -50,8 +50,9 @@ Above may be created using DSL like syntax, or hashes.
50
50
 
51
51
  == Sample programs:
52
52
 
53
+ * sqlc.rb is a ruby sql client demo
53
54
  * rfe : file explorer or Finder like app
54
- * testtodo.rb : a todo app based on a yaml file
55
+ * testtodo.rb : a todo app based on a yaml file (now csv)
55
56
  * test2.rb most widgets (including menus)
56
57
  * test1.rb various kinds of messageboxes (input, list, custom)
57
58
  * testtabp.rb tabbed pane
data/examples/sqlc.rb CHANGED
@@ -1,3 +1,7 @@
1
+ ## rahul kumar, 2009
2
+ # to demonstrate usage of rbcurse
3
+ # Use C-q to quit
4
+ #
1
5
  require 'rubygems'
2
6
  require 'ncurses'
3
7
  require 'logger'
@@ -143,7 +147,7 @@ class Sqlc
143
147
  def run
144
148
  title = "rbcurse"
145
149
  @header = ApplicationHeader.new @form, title, {:text2=>"Demo", :text_center=>"SQL Client"}
146
- status_row = RubyCurses::Label.new @form, {'text' => "", :row => Ncurses.LINES-4, :col => 0, :display_length=>60}
150
+ status_row = RubyCurses::Label.new @form, {'text' => "", :row => Ncurses.LINES-4, :col => 0, :display_length=>70}
147
151
  @status_row = status_row
148
152
  # setting ENTER across all objects on a form
149
153
  @form.bind(:ENTER) {|f| status_row.text = f.help_text unless f.help_text.nil? }
@@ -190,23 +194,20 @@ class Sqlc
190
194
  }
191
195
 
192
196
  # using ampersand to set mnemonic
193
- =begin
194
- b_delrow = Button.new @form do
195
- text "&Delete"
197
+
198
+ b_construct = Button.new @form do
199
+ text "Constr&uct"
196
200
  row buttrow
197
201
  col c+25
198
202
  #bind(:ENTER) { status_row.text "Deletes focussed row" }
199
- help_text ""
203
+ help_text "Select a table, select columns and press this to construct an SQL"
200
204
  end
201
- b_delrow.command {
202
- #@del_cmd.call
203
- }
204
- =end
205
- Button.button_layout [b_run, b_clear], buttrow, startcol=5, cols=Ncurses.COLS-1, gap=5
205
+
206
+ Button.button_layout [b_run, b_clear, b_construct], buttrow, startcol=5, cols=Ncurses.COLS-1, gap=5
206
207
 
207
208
  table_ht = 15
208
209
  atable = Table.new @form do
209
- name "tasktable"
210
+ name "sqltable"
210
211
  row buttrow+1
211
212
  col c
212
213
  width t_width
@@ -283,6 +284,7 @@ class Sqlc
283
284
  #show_selector true
284
285
  title "Tables"
285
286
  title_attrib 'reverse'
287
+ help_text "Press ENTER to run * query, Space to select columns"
286
288
  end
287
289
  #tablelist.bind(:PRESS) { |alist| @status_row.text = "Selected #{alist.current_index}" }
288
290
  tablelist.list_selection_model().bind(:LIST_SELECTION_EVENT,tablelist) { |lsm, alist| @status_row.text = "Selected #{alist.current_index}" }
@@ -301,6 +303,7 @@ class Sqlc
301
303
  #show_selector true
302
304
  title "Columns"
303
305
  title_attrib 'reverse'
306
+ help_text "Press ENTER to append columns to sqlarea, Space to select"
304
307
  end
305
308
  tablelist.bind_key(32) {
306
309
  @status_row.text = "Selected #{tablelist.get_content()[tablelist.current_index]}"
@@ -313,6 +316,26 @@ class Sqlc
313
316
  table = "#{tablelist.get_content()[tablelist.current_index]}"
314
317
  run_query "select * from #{table}"
315
318
  }
319
+ columnlist.bind_key(13) {
320
+ # append column name to sqlarea if ENTER pressed
321
+ column = "#{columnlist.get_content()[columnlist.current_index]}"
322
+ sqlarea << "#{column},"
323
+ }
324
+ columnlist.bind_key(32) {
325
+ # select row
326
+ columnlist.toggle_row_selection
327
+ column = "#{columnlist.get_content()[columnlist.current_index]}"
328
+ }
329
+ b_construct.command {
330
+ table = "#{tablelist.get_content()[tablelist.current_index]}"
331
+ indexes = columnlist.selected_rows()
332
+ columns=[]
333
+ indexes.each do |i|
334
+ columns << columnlist.get_content()[i]
335
+ end
336
+ sql = "select #{columns.join(',')} from #{table}"
337
+ sqlarea << sql
338
+ }
316
339
 
317
340
 
318
341
  @form.repaint
data/lib/rbcurse.rb CHANGED
@@ -3,5 +3,5 @@ require 'ver/window'
3
3
  require 'rbcurse/rwidget'
4
4
  require 'rbcurse/rdialogs'
5
5
  class Rbcurse
6
- VERSION = '0.1.2'
6
+ VERSION = '0.1.3'
7
7
  end
@@ -102,7 +102,9 @@ module RubyCurses
102
102
  def delete obj
103
103
  off0 = @list.index obj
104
104
  return nil if off0.nil?
105
- ret=@list.delete off0
105
+ # 2009-11-04 11:33 next line corrected to delete_at
106
+ #ret=@list.delete off0
107
+ ret=@list.delete_at off0
106
108
  lde = ListDataEvent.new(off0, off0, self, :INTERVAL_REMOVED)
107
109
  fire_handler :LIST_DATA_EVENT, lde
108
110
  return ret
@@ -132,6 +132,7 @@ module RubyCurses
132
132
  data << "\r" if data[-1,1] != "\r" #XXXX
133
133
  @list << data
134
134
  end
135
+ set_modified # added 2009-03-07 18:29
135
136
  goto_end if @auto_scroll # to test out.
136
137
  self
137
138
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbcurse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rahul Kumar
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-22 00:00:00 +05:30
12
+ date: 2009-11-04 00:00:00 +05:30
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 1.8.3
23
+ version: 2.3.3
24
24
  version:
25
25
  description: Ruby curses widgets for easy application development
26
26
  email: sentinel.2001@gmx.com
@@ -33,13 +33,27 @@ extra_rdoc_files:
33
33
  - Manifest.txt
34
34
  - README.txt
35
35
  files:
36
+ - CHANGELOG
36
37
  - History.txt
37
38
  - Manifest.txt
38
39
  - README.txt
39
- - CHANGELOG
40
40
  - Rakefile
41
+ - examples/qdfilechooser.rb
42
+ - examples/rfe.rb
43
+ - examples/rfe_renderer.rb
44
+ - examples/sqlc.rb
45
+ - examples/test1.rb
46
+ - examples/test2.rb
47
+ - examples/testcombo.rb
48
+ - examples/testd.db
49
+ - examples/testkeypress.rb
50
+ - examples/testmenu.rb
51
+ - examples/testtable.rb
52
+ - examples/testtabp.rb
53
+ - examples/testtodo.rb
54
+ - examples/todocsv.csv
55
+ - examples/viewtodo.rb
41
56
  - lib/rbcurse.rb
42
- - test/test_rbcurse.rb
43
57
  - lib/rbcurse/action.rb
44
58
  - lib/rbcurse/applicationheader.rb
45
59
  - lib/rbcurse/celleditor.rb
@@ -74,21 +88,7 @@ files:
74
88
  - lib/ver/keyboard2.rb
75
89
  - lib/ver/ncurses.rb
76
90
  - lib/ver/window.rb
77
- - examples/qdfilechooser.rb
78
- - examples/rfe.rb
79
- - examples/rfe_renderer.rb
80
- - examples/sqlc.rb
81
- - examples/test1.rb
82
- - examples/test2.rb
83
- - examples/testcombo.rb
84
- - examples/testd.db
85
- - examples/testkeypress.rb
86
- - examples/testmenu.rb
87
- - examples/testtable.rb
88
- - examples/testtabp.rb
89
- - examples/testtodo.rb
90
- - examples/todocsv.csv
91
- - examples/viewtodo.rb
91
+ - test/test_rbcurse.rb
92
92
  has_rdoc: true
93
93
  homepage: http://rbcurse.rubyforge.org/
94
94
  post_install_message: