Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding example window shots and fixed bug in Grid

  • Loading branch information...
commit 5a511503b04c1d2322ad6cdfceccc30f65d1fa1c 1 parent 053f6a7
megaannum authored
Showing with 136 additions and 0 deletions.
  1. +136 −0 autoload/forms.vim
  2. BIN  images/examples.png
  3. BIN  images/examples_andmorelabels.png
  4. BIN  images/examples_boxchars.png
  5. BIN  images/examples_checkboxes.png
  6. BIN  images/examples_colorchooser.png
  7. BIN  images/examples_confirmchoice.png
  8. BIN  images/examples_dropshodow.png
  9. BIN  images/examples_filebrowser.png
  10. BIN  images/examples_fixedlayout.png
  11. BIN  images/examples_foureditors.png
  12. BIN  images/examples_frames.png
  13. BIN  images/examples_getinput.png
  14. BIN  images/examples_information.png
  15. BIN  images/examples_labels.png
  16. BIN  images/examples_labelsingrid.png
  17. BIN  images/examples_menusubmenu.png
  18. BIN  images/examples_morelabels.png
  19. BIN  images/examples_palletdesigner.png
  20. BIN  images/examples_popdownlist.png
  21. BIN  images/examples_radiobuttons.png
  22. BIN  images/examples_selectlists.png
  23. BIN  images/examples_sliders.png
  24. BIN  images/examples_subform.png
  25. BIN  images/examples_texteditor.png
  26. BIN  images/examples_textsearch.png
  27. BIN  images/examples_textsearchreplace.png
  28. BIN  images/examples_togglebuttons.png
  29. BIN  images/examples_vlabels.png
  30. BIN  images/menu_edit_colorscheme.png
  31. BIN  images/menu_file.png
  32. BIN  images/popup_change.png
View
136 autoload/forms.vim
@@ -15810,6 +15810,142 @@ function! forms#DrawVBoxes(name, allocation, children_request_size)
endfunction
" ------------------------------------------------------------
+" forms#DrawBoxes: {{{2
+" Draw a grid of boxes with upper-left corner at allocation
+" line/column with column widths and row heights
+" parameters:
+" name : name of box drawing character set
+" allocation : line and column
+" column_widths : list of column widths
+" row_heights : list of row heights
+" ------------------------------------------------------------
+function! forms#DrawBoxes(name, allocation, column_widths, row_heights)
+"silent call forms#log("forms#DrawBoxes: TOP")
+ let a = a:allocation
+ let l = a.line
+ let c = a.column
+ "let w = a.width
+ "let h = a.height
+ let col_ws = a:column_widths
+ let row_hs = a:row_heights
+
+ let boxcharset = forms#LookupBoxDrawingCharacterSet(a:name)
+ let dr = boxcharset[0]
+ let uh = boxcharset[1]
+ let dl = boxcharset[2]
+ let rv = boxcharset[3]
+ let ul = boxcharset[4]
+ let lh = boxcharset[5]
+ let ur = boxcharset[6]
+ let lv = boxcharset[7]
+
+ let hd = forms#LookupDownAndHorizontal(a:name)
+ let hu = forms#LookupUpAndHorizontal(a:name)
+ let vl = forms#LookupVerticalAndLeft(a:name)
+ let vr = forms#LookupVerticalAndRight(a:name)
+ let vh = forms#LookupVerticalAndHorizontal(a:name)
+
+ " outer loop: row 0 to nos_row-1
+ " inner loop: col 0 to nos_col-1
+
+ let nos_row = len(row_hs)
+ let nos_col = len(col_ws)
+
+ let y = l
+ let rcnt = 0
+ while rcnt < nos_row
+ let h = row_hs[rcnt]
+
+ let x = c
+ let ccnt = 0
+ while ccnt < nos_col
+ let w = col_ws[ccnt]
+
+ " draw upper left corner
+ if rcnt == 0
+ if ccnt == 0
+ call forms#SetCharAt(dr, y, x)
+ else
+ call forms#SetCharAt(hd, y, x)
+ endif
+ else
+ if ccnt == 0
+ call forms#SetCharAt(vr, y, x)
+ else
+ call forms#SetCharAt(vh, y, x)
+ endif
+ endif
+
+ " draw top
+ let cnt = 1
+ while cnt < w+1
+ call forms#SetCharAt(uh, y, x+cnt)
+
+ let cnt += 1
+ endwhile
+
+ " draw upper right corner
+ if ccnt == nos_col-1
+ if rcnt == 0
+ call forms#SetCharAt(dl, y, x+w+1)
+ else
+ call forms#SetCharAt(vl, y, x+w+1)
+ endif
+ endif
+
+ " draw left side
+ let cnt = 1
+ while cnt < h+1
+ call forms#SetCharAt(lv, y+cnt, x)
+
+ let cnt += 1
+ endwhile
+ " call forms#SetCharAt(rv, ly+cnt, c+w-1)
+
+ " draw right side
+ if ccnt == nos_col-1
+ let cnt = 1
+ while cnt < h+1
+ call forms#SetCharAt(lv, y+cnt, x+w+1)
+
+ let cnt += 1
+ endwhile
+ endif
+
+ " draw lower left corner
+ if rcnt == nos_row-1
+ if ccnt == 0
+ call forms#SetCharAt(ur, y+h+1, x)
+ else
+ call forms#SetCharAt(hu, y+h+1, x)
+ endif
+ endif
+
+ " draw bottom
+ if rcnt == nos_row-1
+ let cnt = 1
+ while cnt < w+1
+ call forms#SetCharAt(uh, y+h+1, x+cnt)
+
+ let cnt += 1
+ endwhile
+ endif
+
+ " draw lower right corner
+ if rcnt == nos_row-1 && ccnt == nos_col-1
+ call forms#SetCharAt(ul, y+h+1, x+w+1)
+ endif
+
+ let x += w+1
+ let ccnt += 1
+ endwhile
+
+ let y += h+1
+ let rcnt += 1
+ endwhile
+endfunction
+
+" ------------------------------------------------------------
" forms#DrawFrame: {{{2
" Draw a frame with upper-left corner at allocation
" line/column, width and height
View
BIN  images/examples.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_andmorelabels.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_boxchars.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_checkboxes.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_colorchooser.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_confirmchoice.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_dropshodow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_filebrowser.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_fixedlayout.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_foureditors.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_frames.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_getinput.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_information.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_labels.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_labelsingrid.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_menusubmenu.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_morelabels.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_palletdesigner.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_popdownlist.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_radiobuttons.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_selectlists.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_sliders.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_subform.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_texteditor.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_textsearch.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/examples_textsearchreplace.png
Diff not rendered
View
BIN  images/examples_togglebuttons.png
Diff not rendered
View
BIN  images/examples_vlabels.png
Diff not rendered
View
BIN  images/menu_edit_colorscheme.png
Diff not rendered
View
BIN  images/menu_file.png
Diff not rendered
View
BIN  images/popup_change.png
Diff not rendered
Please sign in to comment.
Something went wrong with that request. Please try again.