frm_openaccess.bas 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. Version =20
  2. VersionRequired =20
  3. Begin Form
  4. AllowFilters = NotDefault
  5. PopUp = NotDefault
  6. Modal = NotDefault
  7. RecordSelectors = NotDefault
  8. MaxButton = NotDefault
  9. MinButton = NotDefault
  10. ShortcutMenu = NotDefault
  11. AutoCenter = NotDefault
  12. NavigationButtons = NotDefault
  13. AllowDeletions = NotDefault
  14. DividingLines = NotDefault
  15. AllowAdditions = NotDefault
  16. DefaultView =0
  17. ScrollBars =0
  18. ViewsAllowed =1
  19. BorderStyle =1
  20. PictureAlignment =2
  21. DatasheetGridlinesBehavior =3
  22. GridY =10
  23. Width =8163
  24. DatasheetFontHeight =11
  25. ItemSuffix =20
  26. Left =3060
  27. Top =2055
  28. Right =13650
  29. Bottom =10335
  30. DatasheetGridlinesColor =14806254
  31. RecSrcDt = Begin
  32. 0x97e87bbff3d2e440
  33. End
  34. Caption ="OpenAccess"
  35. DatasheetFontName ="Calibri"
  36. OnLoad ="[Event Procedure]"
  37. AllowDatasheetView =0
  38. AllowPivotTableView =0
  39. AllowPivotChartView =0
  40. AllowPivotChartView =0
  41. FilterOnLoad =0
  42. ShowPageMargins =0
  43. DisplayOnSharePointSite =1
  44. AllowLayoutView =0
  45. DatasheetAlternateBackColor =15921906
  46. DatasheetGridlinesColor12 =0
  47. FitToScreen =1
  48. DatasheetBackThemeColorIndex =1
  49. BorderThemeColorIndex =3
  50. ThemeFontIndex =1
  51. ForeThemeColorIndex =0
  52. AlternateBackThemeColorIndex =1
  53. AlternateBackShade =95.0
  54. Begin
  55. Begin Label
  56. BackStyle =0
  57. FontSize =11
  58. FontName ="Calibri"
  59. ThemeFontIndex =1
  60. BackThemeColorIndex =1
  61. BorderThemeColorIndex =0
  62. BorderTint =50.0
  63. ForeThemeColorIndex =0
  64. ForeTint =50.0
  65. GridlineThemeColorIndex =1
  66. GridlineShade =65.0
  67. End
  68. Begin CommandButton
  69. Width =1701
  70. Height =283
  71. FontSize =11
  72. FontWeight =400
  73. FontName ="Calibri"
  74. ForeThemeColorIndex =0
  75. ForeTint =75.0
  76. GridlineThemeColorIndex =1
  77. GridlineShade =65.0
  78. UseTheme =1
  79. Shape =1
  80. Gradient =12
  81. BackThemeColorIndex =4
  82. BackTint =60.0
  83. BorderLineStyle =0
  84. BorderColor =16777215
  85. BorderThemeColorIndex =4
  86. BorderTint =60.0
  87. ThemeFontIndex =1
  88. HoverThemeColorIndex =4
  89. HoverTint =40.0
  90. PressedThemeColorIndex =4
  91. PressedShade =75.0
  92. HoverForeThemeColorIndex =0
  93. HoverForeTint =75.0
  94. PressedForeThemeColorIndex =0
  95. PressedForeTint =75.0
  96. End
  97. Begin OptionGroup
  98. SpecialEffect =3
  99. BorderLineStyle =0
  100. Width =1701
  101. Height =1701
  102. BackThemeColorIndex =1
  103. BorderThemeColorIndex =1
  104. BorderShade =65.0
  105. GridlineThemeColorIndex =1
  106. GridlineShade =65.0
  107. End
  108. Begin TextBox
  109. AddColon = NotDefault
  110. FELineBreak = NotDefault
  111. BorderLineStyle =0
  112. Width =1701
  113. LabelX =-1701
  114. FontSize =11
  115. FontName ="Calibri"
  116. AsianLineBreak =1
  117. BackThemeColorIndex =1
  118. BorderThemeColorIndex =1
  119. BorderShade =65.0
  120. ThemeFontIndex =1
  121. ForeThemeColorIndex =0
  122. ForeTint =75.0
  123. GridlineThemeColorIndex =1
  124. GridlineShade =65.0
  125. End
  126. Begin ComboBox
  127. AddColon = NotDefault
  128. BorderLineStyle =0
  129. Width =1701
  130. LabelX =-1701
  131. FontSize =11
  132. FontName ="Calibri"
  133. AllowValueListEdits =1
  134. InheritValueList =1
  135. ThemeFontIndex =1
  136. BackThemeColorIndex =1
  137. BorderThemeColorIndex =1
  138. BorderShade =65.0
  139. ForeThemeColorIndex =2
  140. ForeShade =50.0
  141. GridlineThemeColorIndex =1
  142. GridlineShade =65.0
  143. End
  144. Begin Section
  145. CanGrow = NotDefault
  146. Height =2437
  147. Name ="Détail"
  148. AlternateBackColor =15921906
  149. AlternateBackThemeColorIndex =1
  150. AlternateBackShade =95.0
  151. BackThemeColorIndex =1
  152. Begin
  153. Begin Label
  154. OverlapFlags =85
  155. TextAlign =2
  156. TextFontFamily =49
  157. Left =165
  158. Top =60
  159. Width =7845
  160. Height =330
  161. FontSize =12
  162. FontWeight =700
  163. BorderColor =8355711
  164. ForeColor =8355711
  165. Name ="lbl_title"
  166. Caption ="OpenAccess - Generate your Source Code"
  167. FontName ="Consolas"
  168. GridlineColor =10921638
  169. LayoutCachedLeft =165
  170. LayoutCachedTop =60
  171. LayoutCachedWidth =8010
  172. LayoutCachedHeight =390
  173. ThemeFontIndex =-1
  174. End
  175. Begin ComboBox
  176. LimitToList = NotDefault
  177. OverlapFlags =85
  178. TextFontFamily =49
  179. IMESentenceMode =3
  180. ColumnCount =4
  181. Left =170
  182. Top =623
  183. Width =2828
  184. Height =390
  185. FontSize =10
  186. BorderColor =10921638
  187. ForeColor =4138256
  188. ColumnInfo ="\"\";\"\";\"\";\"\";\"\";\"\";\"\";\"\";\"10\";\"100\""
  189. Name ="cb_command"
  190. RowSourceType ="Table/Query"
  191. RowSource ="SELECT tbl_commands.cmd_name, tbl_commands.function, tbl_commands.description, t"
  192. "bl_commands.with_args FROM tbl_commands ORDER BY tbl_commands.order; "
  193. ColumnWidths ="5670;0;0;0"
  194. FontName ="Consolas"
  195. OnChange ="[Event Procedure]"
  196. GridlineColor =10921638
  197. AllowValueListEdits =0
  198. InheritValueList =0
  199. LayoutCachedLeft =170
  200. LayoutCachedTop =623
  201. LayoutCachedWidth =2998
  202. LayoutCachedHeight =1013
  203. ThemeFontIndex =-1
  204. End
  205. Begin CommandButton
  206. OverlapFlags =85
  207. TextFontFamily =49
  208. Left =7143
  209. Top =623
  210. Width =850
  211. Height =390
  212. TabIndex =2
  213. ForeColor =4210752
  214. Name ="cmd_run"
  215. Caption ="Run"
  216. OnClick ="[Event Procedure]"
  217. FontName ="Consolas"
  218. GridlineColor =10921638
  219. LayoutCachedLeft =7143
  220. LayoutCachedTop =623
  221. LayoutCachedWidth =7993
  222. LayoutCachedHeight =1013
  223. UseTheme =0
  224. BackColor =14136213
  225. BorderColor =14136213
  226. ThemeFontIndex =-1
  227. HoverColor =15060409
  228. PressedColor =9592887
  229. HoverForeColor =4210752
  230. PressedForeColor =4210752
  231. WebImagePaddingLeft =2
  232. WebImagePaddingTop =2
  233. WebImagePaddingRight =1
  234. WebImagePaddingBottom =1
  235. Overlaps =1
  236. End
  237. Begin Label
  238. OverlapFlags =85
  239. TextFontFamily =49
  240. Left =165
  241. Top =1185
  242. Width =7830
  243. Height =735
  244. FontSize =10
  245. BorderColor =8355711
  246. Name ="lbl_help"
  247. Caption ="Runs a git command"
  248. FontName ="Consolas"
  249. GridlineColor =10921638
  250. LayoutCachedLeft =165
  251. LayoutCachedTop =1185
  252. LayoutCachedWidth =7995
  253. LayoutCachedHeight =1920
  254. ThemeFontIndex =-1
  255. ForeTint =100.0
  256. End
  257. Begin Label
  258. FontItalic = NotDefault
  259. OverlapFlags =85
  260. TextAlign =3
  261. TextFontFamily =49
  262. Left =2040
  263. Top =2040
  264. Width =5949
  265. Height =223
  266. FontSize =8
  267. BorderColor =8355711
  268. Name ="Étiquette15"
  269. Caption ="Conseil départemental du Bas-Rhin, 2016"
  270. FontName ="Consolas"
  271. GridlineColor =10921638
  272. LayoutCachedLeft =2040
  273. LayoutCachedTop =2040
  274. LayoutCachedWidth =7989
  275. LayoutCachedHeight =2263
  276. ThemeFontIndex =-1
  277. ForeTint =100.0
  278. End
  279. Begin TextBox
  280. OverlapFlags =85
  281. TextFontFamily =49
  282. IMESentenceMode =3
  283. Left =3118
  284. Top =623
  285. Width =3860
  286. Height =390
  287. FontSize =10
  288. TabIndex =1
  289. BorderColor =10921638
  290. ForeColor =4138256
  291. Name ="txt_args"
  292. FontName ="Consolas"
  293. GridlineColor =10921638
  294. LayoutCachedLeft =3118
  295. LayoutCachedTop =623
  296. LayoutCachedWidth =6978
  297. LayoutCachedHeight =1013
  298. ThemeFontIndex =-1
  299. ForeThemeColorIndex =2
  300. ForeTint =100.0
  301. ForeShade =50.0
  302. End
  303. End
  304. End
  305. End
  306. End
  307. CodeBehindForm
  308. Attribute VB_GlobalNameSpace = False
  309. Attribute VB_Creatable = True
  310. Attribute VB_PredeclaredId = True
  311. Attribute VB_Exposed = False
  312. Option Compare Database
  313. Private Sub cb_command_Change()
  314. Call update
  315. End Sub
  316. Private Sub cmd_run_Click()
  317. Call run
  318. End Sub
  319. Private Sub Form_Load()
  320. Call update
  321. End Sub
  322. Sub update()
  323. Me.lbl_help.Caption = Nz(Me.cb_command.Column(2), "")
  324. Me.txt_args.Enabled = Nz(Me.cb_command.Column(3), False)
  325. If Me.txt_args.Enabled Then
  326. Me.txt_args.SetFocus
  327. Else
  328. Me.cmd_run.SetFocus
  329. End If
  330. End Sub
  331. Sub run()
  332. Dim result As Variant
  333. If Not Me.txt_args.Enabled Then
  334. result = Application.run(Me.cb_command.Column(1))
  335. Else
  336. result = Application.run(Me.cb_command.Column(1), Nz(Me.txt_args, ""))
  337. End If
  338. Call display_status(result)
  339. End Sub
  340. Private Sub display_status(result As Variant)
  341. On Error GoTo err
  342. Dim msg As String
  343. msg = "Operation ended with status: " & vbNewLine
  344. Select Case CInt(result)
  345. Case opCompleted
  346. msg = msg & "> Done"
  347. Case opInterrupted
  348. msg = msg & "> Interrupted"
  349. Case opCancelled
  350. msg = msg & "> Cancelled"
  351. Case Else
  352. GoTo err
  353. End Select
  354. MsgBox msg, vbInformation, "Open Access"
  355. Exit Sub
  356. err:
  357. MsgBox msg & "> (unable to read the returned status)", vbExclamation, "Open Access"
  358. End Sub