Browse Source

Initial release on http://luaforge.net

Jean-Francois Goulet 19 years ago
parent
commit
34db8aa55e
38 changed files with 2373 additions and 0 deletions
  1. 492 0
      LuaEdit/GUIControls.dfm
  2. 139 0
      LuaEdit/GUIControls.pas
  3. 30 0
      LuaEdit/GUIDesigner.dfm
  4. 90 0
      LuaEdit/GUIDesigner.pas
  5. 60 0
      LuaEdit/GUIFormType.dfm
  6. 34 0
      LuaEdit/GUIFormType.pas
  7. 81 0
      LuaEdit/GUIInspector.dfm
  8. 39 0
      LuaEdit/GUIInspector.pas
  9. BIN
      LuaEdit/Graphics/DotNet_Style/ButtonCtrl.bmp
  10. BIN
      LuaEdit/Graphics/DotNet_Style/CheckBoxCtrl.bmp
  11. BIN
      LuaEdit/Graphics/DotNet_Style/Compile.bmp
  12. BIN
      LuaEdit/Graphics/DotNet_Style/EditCtrl.bmp
  13. BIN
      LuaEdit/Graphics/DotNet_Style/ErrorMsg.bmp
  14. BIN
      LuaEdit/Graphics/DotNet_Style/FileModified.bmp
  15. BIN
      LuaEdit/Graphics/DotNet_Style/FileNew.bmp
  16. BIN
      LuaEdit/Graphics/DotNet_Style/FileNotLoaded.bmp
  17. BIN
      LuaEdit/Graphics/DotNet_Style/FileOk.bmp
  18. BIN
      LuaEdit/Graphics/DotNet_Style/FileReadOnly.bmp
  19. BIN
      LuaEdit/Graphics/DotNet_Style/GUIInspector.bmp
  20. BIN
      LuaEdit/Graphics/DotNet_Style/HintMsg.bmp
  21. BIN
      LuaEdit/Graphics/DotNet_Style/ImageCtrl.bmp
  22. BIN
      LuaEdit/Graphics/DotNet_Style/LabelCtrl.bmp
  23. BIN
      LuaEdit/Graphics/DotNet_Style/MacroManager.bmp
  24. BIN
      LuaEdit/Graphics/DotNet_Style/NewGUIForm.bmp
  25. BIN
      LuaEdit/Graphics/DotNet_Style/NewGUIFormGrayed.bmp
  26. BIN
      LuaEdit/Graphics/DotNet_Style/NewMacro.bmp
  27. BIN
      LuaEdit/Graphics/DotNet_Style/NewMacroGrayed.bmp
  28. BIN
      LuaEdit/Graphics/DotNet_Style/NewText.bmp
  29. BIN
      LuaEdit/Graphics/DotNet_Style/NewTextGrayed.bmp
  30. BIN
      LuaEdit/Graphics/DotNet_Style/Profiler.bmp
  31. BIN
      LuaEdit/Graphics/DotNet_Style/RadioButtonCtrl.bmp
  32. BIN
      LuaEdit/Graphics/DotNet_Style/SelectCtrl.bmp
  33. BIN
      LuaEdit/Graphics/DotNet_Style/ToolBox.bmp
  34. BIN
      LuaEdit/Graphics/DotNet_Style/UnitGrayed.bmp
  35. BIN
      LuaEdit/Graphics/DotNet_Style/WarningMsg.bmp
  36. 711 0
      LuaEdit/LEMacros.pas
  37. 293 0
      LuaEdit/MacroManager.dfm
  38. 404 0
      LuaEdit/MacroManager.pas

+ 492 - 0
LuaEdit/GUIControls.dfm

@@ -0,0 +1,492 @@
+object frmGUIControls: TfrmGUIControls
+  Left = 776
+  Top = 196
+  Width = 212
+  Height = 524
+  BorderStyle = bsSizeToolWin
+  Caption = 'GUI Controls'
+  Color = clBtnFace
+  DockSite = True
+  DragKind = dkDock
+  DragMode = dmAutomatic
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'MS Sans Serif'
+  Font.Style = []
+  FormStyle = fsStayOnTop
+  OldCreateOrder = False
+  OnCreate = FormCreate
+  PixelsPerInch = 96
+  TextHeight = 13
+  object jvGUIControls: TJvOutlookBar
+    Left = 0
+    Top = 0
+    Width = 204
+    Height = 497
+    Align = alClient
+    Pages = <
+      item
+        Alignment = taLeftJustify
+        Buttons = <>
+        ButtonSize = olbsSmall
+        Caption = 'Standard'
+        Color = clBtnFace
+        DownFont.Charset = DEFAULT_CHARSET
+        DownFont.Color = clWindowText
+        DownFont.Height = -11
+        DownFont.Name = 'MS Sans Serif'
+        DownFont.Style = []
+        Font.Charset = DEFAULT_CHARSET
+        Font.Color = clWhite
+        Font.Height = -11
+        Font.Name = 'MS Sans Serif'
+        Font.Style = []
+        ParentButtonSize = False
+        ParentColor = True
+        TopButtonIndex = 0
+      end
+      item
+        Alignment = taLeftJustify
+        Buttons = <>
+        ButtonSize = olbsLarge
+        Caption = 'Additional'
+        Color = clBtnFace
+        DownFont.Charset = DEFAULT_CHARSET
+        DownFont.Color = clWindowText
+        DownFont.Height = -11
+        DownFont.Name = 'MS Sans Serif'
+        DownFont.Style = []
+        Font.Charset = DEFAULT_CHARSET
+        Font.Color = clWhite
+        Font.Height = -11
+        Font.Name = 'MS Sans Serif'
+        Font.Style = []
+        ParentColor = True
+        TopButtonIndex = 0
+      end>
+    ThemedBackground = False
+    OnCustomDraw = jvGUIControlsCustomDraw
+    OnPageChange = jvGUIControlsPageChange
+    Color = clBtnFace
+    Font.Charset = DEFAULT_CHARSET
+    Font.Color = clWindowText
+    Font.Height = -11
+    Font.Name = 'MS Sans Serif'
+    Font.Style = [fsBold]
+    ParentFont = False
+    TabOrder = 0
+  end
+  object JvDockClient1: TJvDockClient
+    DirectDrag = False
+    DockStyle = frmLuaEditMain.jvDockVSNet
+    Left = 16
+    Top = 112
+  end
+  object imlControls: TImageList
+    Left = 16
+    Top = 80
+    Bitmap = {
+      494C010107000900040010001000FFFFFFFFFF00FFFFFFFFFFFFFFFF424D3600
+      0000000000003600000028000000400000003000000001002000000000000030
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000FF00FF000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000FF00FF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0000000000FFFFFF000000
+      00000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF0000000000FF00FF000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000FF00FF0080808000808080008080
+      8000808080008080800080808000808080008080800080808000808080008080
+      800080808000FFFFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FFFFFF00FFFFFF00C8D0D400C8D0D400C8D0D400C8D0D400FFFFFF00FFFF
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0000000000FFFFFF00FFFF
+      FF00000000000000000000000000FFFFFF00000000000000000000000000FFFF
+      FF00FFFFFF00FFFFFF0000000000FF00FF000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000FF00FF008080800000000000FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF0080808000FFFFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008080
+      8000C8D0D400C8D0D400FFFFFF00FFFFFF00FFFFFF00FFFFFF00C8D0D400C8D0
+      D400FFFFFF00FF00FF00FF00FF00FF00FF00FF00FF0000000000FFFFFF00FFFF
+      FF0000000000C8D0D40000000000FFFFFF00FFFFFF0000000000000000000000
+      000000000000FFFFFF0000000000FF00FF000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000FF00FF008080800000000000FFFF
+      FF000000000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF
+      FF0080808000FFFFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008080
+      800000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00C8D0
+      D400FFFFFF00FF00FF00FF00FF00FF00FF00FF00FF0000000000FFFFFF00FFFF
+      FF0000000000C8D0D400C8D0D40000000000FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF0000000000FF00FF000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000FF00FF008080800000000000FFFF
+      FF00000000000000000000000000FFFFFF00000000000000000000000000FFFF
+      FF0080808000FFFFFF00FF00FF00FF00FF00FF00FF00FF00FF00808080000000
+      0000FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF
+      FF00C8D0D400FFFFFF00FF00FF00FF00FF00FF00FF0000000000000000000000
+      000000000000C8D0D40000000000C8D0D4000000000000000000000000000000
+      0000000000000000000000000000FF00FF000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000FF00FF008080800000000000FFFF
+      FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF
+      FF0080808000FFFFFF00FF00FF00FF00FF00FF00FF00FF00FF00808080000000
+      0000FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFF
+      FF00C8D0D400FFFFFF00FF00FF00FF00FF00FF00FF0000000000FFFFFF008080
+      8000C8D0D400C8D0D4000000000000000000C8D0D40000000000FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF0000000000FF00FF000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000FF00FF008080800000000000FFFF
+      FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF
+      FF0080808000FFFFFF00FF00FF00FF00FF00FF00FF00FF00FF00808080000000
+      0000FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFF
+      FF00C8D0D400FFFFFF00FF00FF00FF00FF00FF00FF0000000000FFFFFF000000
+      000000000000C8D0D4000000000000000000C8D0D40000000000FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF0000000000FF00FF000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000FF00FF008080800000000000FFFF
+      FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF
+      FF0080808000FFFFFF00FF00FF00FF00FF00FF00FF00FF00FF00808080000000
+      0000FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF
+      FF00C8D0D400FFFFFF00FF00FF00FF00FF00FF00FF0000000000FFFFFF000000
+      000000000000C8D0D400000000000000000000000000FFFFFF00808080000000
+      000080808000FFFFFF0000000000FF00FF000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000FF00FF008080800000000000FFFF
+      FF00000000000000000000000000FFFFFF00000000000000000000000000FFFF
+      FF0080808000FFFFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008080
+      800000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00C8D0
+      D400FFFFFF00FF00FF00FF00FF00FF00FF00FF00FF0000000000FFFFFF008080
+      800000000000C8D0D40000000000FFFFFF00FFFFFF00FFFFFF0000000000C8D0
+      D40000000000FFFFFF0000000000FF00FF000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000FF00FF008080800000000000FFFF
+      FF000000000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF
+      FF0080808000FFFFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008080
+      80000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000
+      0000FFFFFF00FF00FF00FF00FF00FF00FF00FF00FF0000000000FFFFFF00FFFF
+      FF00808080000000000080808000FFFFFF00FFFFFF00FFFFFF00808080000000
+      000080808000FFFFFF0000000000FF00FF000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000FF00FF008080800000000000FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF0080808000FFFFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00808080008080800000000000000000000000000000000000808080008080
+      8000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0000000000FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF0000000000FF00FF000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000FF00FF0080808000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000080808000FFFFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF0080808000808080008080800080808000FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000FF00FF000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000FF00FF0080808000808080008080
+      8000808080008080800080808000808080008080800080808000808080008080
+      800080808000FFFFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF000000000000000000FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF000000000000000000FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF0000000000FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF000000000000000000FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF000000000000000000000000000000
+      0000FFFFFF00FFFFFF0000000000000000000000000000000000000000000000
+      0000FFFFFF00808080000000000000000000FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FFFFFF0000000000000000000000
+      00000000000000000000FFFFFF00000000000000000000000000000000000000
+      0000FFFFFF00FFFFFF0000000000FF00FF00FF00FF00FF00FF00FF00FF000000
+      0000FF00FF00FF00FF00FF00FF000000000000000000FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FFFFFF008080800000000000FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00000000008080
+      800000000000FFFFFF0000000000FFFFFF00FF00FF00FF00FF00000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000FF00FF00FF00FF00FF00FF000000000000000000FFFFFF00FFFF
+      FF000000000000000000FFFFFF000000000000000000FFFFFF00FFFFFF000000
+      000000000000FFFFFF0000000000FF00FF00FF00FF00FF00FF00FF00FF000000
+      000000000000FF00FF000000000000000000FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FFFFFF00808080000000
+      0000FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00000000008080
+      8000FFFFFF000000000000000000FFFFFF00FF00FF0000000000808080008080
+      8000808080008080800080808000808080008080800080808000808080008080
+      80008080800000000000FF00FF00FF00FF000000000000000000FFFFFF00FFFF
+      FF000000000000000000FFFFFF000000000000000000FFFFFF00FFFFFF000000
+      000000000000FFFFFF0000000000FF00FF00FF00FF00FF00FF00FF00FF000000
+      000000000000000000000000000000000000FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FFFFFF008080
+      80000000000000000000000000000000000000000000FFFFFF00808080000000
+      0000FFFFFF00FFFFFF000000000080808000FF00FF0000000000FFFFFF00C8D0
+      D400C8D0D400C8D0D400C8D0D400C8D0D400C8D0D400C8D0D400C8D0D400C8D0
+      D4008080800000000000FF00FF00FF00FF00FFFFFF000000000000000000FFFF
+      FF000000000000000000FFFFFF000000000000000000FFFFFF00FFFFFF000000
+      000000000000FFFFFF0000000000FF00FF00FF00FF00FF00FF00FF00FF000000
+      000000000000000000000000000000000000000000000000000000000000FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FFFF
+      FF0000000000FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF000000
+      000000000000FFFFFF000000000000000000FF00FF0000000000FFFFFF00C8D0
+      D400C8D0D400C8D0D400C8D0D400C8D0D400C8D0D400C8D0D400C8D0D400C8D0
+      D4008080800000000000FF00FF00FF00FF00FF00FF00FFFFFF00000000000000
+      00000000000000000000FFFFFF000000000000000000FFFFFF00FFFFFF000000
+      000000000000FFFFFF0000000000FF00FF00FF00FF00FF00FF00FF00FF000000
+      0000000000000000000000000000000000000000000000000000FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FFFFFF0000000000FFFFFF000000000000000000FFFFFF00FF00FF00FFFF
+      FF000000000000000000FFFFFF0000000000FF00FF0000000000FFFFFF00C8D0
+      D400C8D0D400C8D0D400C8D0D400C8D0D400C8D0D400C8D0D400C8D0D400C8D0
+      D4008080800000000000FF00FF00FF00FF000000000000000000FFFFFF00FFFF
+      FF000000000000000000FFFFFF000000000000000000FFFFFF00FFFFFF000000
+      000000000000FFFFFF0000000000FF00FF00FF00FF00FF00FF00FF00FF000000
+      00000000000000000000000000000000000000000000FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FFFFFF00000000000000000000000000FFFFFF00FF00FF00FF00
+      FF00FFFFFF00FFFFFF00FF00FF00FFFFFF00FF00FF0000000000FFFFFF00C8D0
+      D400C8D0D400C8D0D400C8D0D400C8D0D400C8D0D400C8D0D400C8D0D400C8D0
+      D4008080800000000000FF00FF00FF00FF00FFFFFF0000000000000000000000
+      000000000000FFFFFF00FFFFFF00000000000000000000000000000000000000
+      0000FFFFFF00FFFFFF0000000000FF00FF00FF00FF00FF00FF00FF00FF000000
+      000000000000000000000000000000000000FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FFFFFF00808080000000000000000000FFFFFF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0000000000FFFFFF00C8D0
+      D400C8D0D400C8D0D400C8D0D400C8D0D400C8D0D400C8D0D400C8D0D400C8D0
+      D4008080800000000000FF00FF00FF00FF00FF00FF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FF00FF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF0000000000FF00FF00FF00FF00FF00FF00FF00FF000000
+      0000000000000000000000000000FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FFFFFF008080800000000000FFFFFF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0000000000FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF008080800000000000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FFFFFF000000000000000000FFFFFF00FF00FF00FF00
+      FF00FF00FF00FFFFFF0000000000FF00FF00FF00FF00FF00FF00FF00FF000000
+      00000000000000000000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FFFFFF0080808000FFFFFF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FFFFFF000000000000000000FFFFFF00FF00FF00FF00
+      FF00FF00FF00FFFFFF0000000000FF00FF00FF00FF00FF00FF00FF00FF000000
+      000000000000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FFFFFF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF00FF00FF00
+      FF00FF00FF00FFFFFF0000000000FF00FF00FF00FF00FF00FF00FF00FF000000
+      0000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+      FF00FF00FF00FF00FF00FF00FF00FF00FF00424D3E000000000000003E000000
+      2800000040000000300000000100010000000000800100000000000000000000
+      000000000000000000000000FFFFFF0000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      00000000000000000000000000000000}
+  end
+end

+ 139 - 0
LuaEdit/GUIControls.pas

@@ -0,0 +1,139 @@
+unit GUIControls;
+
+interface
+
+uses
+  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+  Dialogs, JvJVCLUtils, JvComponent, JvDockControlForm, JvExControls,
+  ExtCtrls, JvOutlookBar, ImgList;
+
+type
+  TfrmGUIControls = class(TForm)
+    jvGUIControls: TJvOutlookBar;
+    JvDockClient1: TJvDockClient;
+    imlControls: TImageList;
+    procedure jvGUIControlsCustomDraw(Sender: TObject; ACanvas: TCanvas; ARect: TRect; AStage: TJvOutlookBarCustomDrawStage; AIndex: Integer; ADown, AInside: Boolean; var DefaultDraw: Boolean);
+    procedure FormCreate(Sender: TObject);
+    procedure jvGUIControlsPageChange(Sender: TObject; Index: Integer);
+  private
+    { Private declarations }
+    procedure btnXControlClick(Sender: TObject);
+    procedure CreateList();
+  public
+    { Public declarations }
+  end;
+
+var
+  frmGUIControls: TfrmGUIControls;
+
+implementation
+
+{$R *.dfm}
+
+procedure TfrmGUIControls.jvGUIControlsCustomDraw(Sender: TObject; ACanvas: TCanvas; ARect: TRect; AStage: TJvOutlookBarCustomDrawStage; AIndex: Integer; ADown, AInside: Boolean; var DefaultDraw: Boolean);
+var
+  pImage: TBitmap;
+begin
+  DefaultDraw := False;
+
+  case AStage of
+    odsBackground:
+      // Draw the background
+      GradientFillRect(ACanvas, ARect, clBtnFace, clBtnFace, fdTopToBottom, 255);
+
+    odsPage:
+      // Draw the page
+      GradientFillRect(ACanvas,ARect, clBtnFace, clBtnFace, fdTopToBottom, 255);
+
+    odsPageButton:
+    begin
+      // Draw the page button
+      GradientFillRect(ACanvas,ARect, clBtnFace, clBtnFace, fdTopToBottom, 255);
+
+      if ADown then
+        OffsetRect(ARect,1,1);
+
+      Frame3D(ACanvas, ARect, clBtnHighlight, clBtnShadow, 2);
+      ACanvas.Font.Color := clBlack;
+      ARect.Left := ARect.Left + 18;
+      DrawText(ACanvas.Handle, PChar(' '+jvGUIControls.Pages[AIndex].Caption), Length(jvGUIControls.Pages[AIndex].Caption)+1, ARect, DT_SINGLELINE or DT_VCENTER or DT_LEFT);
+    end;
+
+    odsButton:
+    begin
+      // Draw small button image if required
+      if jvGUIControls.ActivePage.Buttons[AIndex].ImageIndex <> -1 then
+      begin
+        pImage := TBitmap.Create;
+        imlControls.GetBitmap(jvGUIControls.ActivePage.Buttons[AIndex].ImageIndex, pImage);
+        pImage.Transparent := True;
+        pImage.TransparentColor := pImage.Canvas.Pixels[0, 0];
+        pImage.TransparentMode := tmAuto;
+        ACanvas.Draw(ARect.Left + 1, ARect.Top + 3, pImage);
+        pImage.Free;
+      end;
+
+      // Draw the button
+      ACanvas.Font.Color := clBlack;
+      ARect.Left := ARect.Left + 17;
+      DrawText(ACanvas.Handle, PChar(' '+jvGUIControls.ActivePage.Buttons[AIndex].Caption), Length(jvGUIControls.ActivePage.Buttons[AIndex].Caption)+1, ARect, DT_SINGLELINE or DT_VCENTER or DT_LEFT or DT_MODIFYSTRING or DT_END_ELLIPSIS);
+    end;
+
+    odsButtonFrame:
+    begin
+      // Draw button frame according to its down value (this is called if the button is down or if the mouse is over)
+      if ADown then
+        Frame3D(ACanvas, ARect, clBtnShadow, clBtnHighlight, 2)
+      else
+        Frame3D(ACanvas, ARect, clBtnHighlight, clBtnShadow, 2);
+    end;
+  end;
+end;
+
+procedure TfrmGUIControls.jvGUIControlsPageChange(Sender: TObject; Index: Integer);
+begin
+  jvGUIControls.Pages[Index].DownIndex := 0;
+end;
+
+procedure TfrmGUIControls.btnXControlClick(Sender: TObject);
+var
+  btnSender: TJvOutlookBarButton;
+begin
+  btnSender := TJvOutlookBarButton(Sender);
+  btnSender.Down := True;
+end;
+
+procedure TfrmGUIControls.CreateList();
+  // This method add a button to the controls list
+  procedure AddOBButton(pOnClick: TNotifyEvent; iPageIndex: Integer; iImageIndex: Integer; sCaption: String; bDown: Boolean = False; bEnabled: Boolean = True);
+  var
+    jvOBBtn: TJvOutlookBarButton;
+  begin
+    jvOBBtn := jvGUIControls.Pages[iPageIndex].Buttons.Add();
+    jvOBBtn.Caption := sCaption;
+    jvOBBtn.ImageIndex := iImageIndex;
+    jvOBBtn.Down := bDown;
+    jvOBBtn.Enabled := bEnabled;
+    jvOBBtn.OnClick := pOnClick;
+  end;
+
+begin
+  // Create standard controls...
+  AddOBButton(btnXControlClick, 0, 0, 'Select', True);
+  AddOBButton(btnXControlClick, 0, 1, 'Label');
+  AddOBButton(btnXControlClick, 0, 2, 'Button');
+  AddOBButton(btnXControlClick, 0, 3, 'Edit');
+  AddOBButton(btnXControlClick, 0, 4, 'CheckBox');
+  AddOBButton(btnXControlClick, 0, 5, 'RadioButton');
+
+  // Create additional controls...
+  AddOBButton(btnXControlClick, 1, 0, 'Select', True);
+  AddOBButton(btnXControlClick, 1, 6, 'Image');
+end;
+
+procedure TfrmGUIControls.FormCreate(Sender: TObject);
+begin
+  CreateList();
+end;
+
+end.

+ 30 - 0
LuaEdit/GUIDesigner.dfm

@@ -0,0 +1,30 @@
+object GUIForm1: TGUIForm1
+  Left = 669
+  Top = 277
+  Width = 250
+  Height = 250
+  Caption = 'Form1'
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'MS Sans Serif'
+  Font.Style = []
+  FormStyle = fsStayOnTop
+  OldCreateOrder = False
+  Position = poScreenCenter
+  Visible = True
+  OnCloseQuery = FormCloseQuery
+  OnShow = FormShow
+  PixelsPerInch = 96
+  TextHeight = 13
+  object ELGUIDesigner: TELDesigner
+    ClipboardFormat = 'Extension Library designer components'
+    OnModified = ELGUIDesignerModified
+    OnControlInserting = ELGUIDesignerControlInserting
+    OnControlInserted = ELGUIDesignerControlInserted
+    OnChangeSelection = ELGUIDesignerChangeSelection
+    Left = 16
+    Top = 16
+  end
+end

+ 90 - 0
LuaEdit/GUIDesigner.pas

@@ -0,0 +1,90 @@
+unit GUIDesigner;
+
+interface
+
+uses
+  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+  Dialogs, ELDsgnr, StdCtrls, ExtCtrls, Misc;
+
+type
+  TGUIForm1 = class(TForm)
+    ELGUIDesigner: TELDesigner;
+    procedure FormShow(Sender: TObject);
+    procedure ELGUIDesignerChangeSelection(Sender: TObject);
+    procedure ELGUIDesignerControlInserting(Sender: TObject; var AControlClass: TControlClass);
+    procedure ELGUIDesignerControlInserted(Sender: TObject);
+    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
+    procedure ELGUIDesignerModified(Sender: TObject);
+  private
+    { Private declarations }
+  public
+    { Public declarations }
+    pLuaEditGUIForm: TLuaEditGUIForm;
+  end;
+
+var
+  GUIForm1: TGUIForm1;
+
+implementation
+
+uses GUIInspector, GUIControls;
+
+{$R *.dfm}
+
+procedure TGUIForm1.FormShow(Sender: TObject);
+begin
+  ELGUIDesigner.DesignControl := Self;
+  ELGUIDesigner.Active := True;
+end;
+
+procedure TGUIForm1.ELGUIDesignerChangeSelection(Sender: TObject);
+var
+  lstObjects: TList;
+begin
+  try
+    lstObjects := TList.Create;
+    frmGUIInspector.ELGUIPropertyInspector.Clear;
+    ELGUIDesigner.SelectedControls.GetControls(lstObjects);
+    frmGUIInspector.ELGUIPropertyInspector.AssignObjects(lstObjects);
+  finally
+    lstObjects.Free;
+  end;
+end;
+
+procedure TGUIForm1.ELGUIDesignerControlInserting(Sender: TObject; var AControlClass: TControlClass);
+var
+  sCtrlName: String;
+begin
+  sCtrlName := UpperCase(frmGUIControls.jvGUIControls.ActivePage.DownButton.Caption);
+
+  if sCtrlName = 'LABEL' then
+    AControlClass := TLabel
+  else if sCtrlName = 'BUTTON' then
+    AControlClass := TButton
+  else if sCtrlName = 'EDIT' then
+    AControlClass := TEdit
+  else if sCtrlName = 'CHECKBOX' then
+    AControlClass := TCheckBox
+  else if sCtrlName = 'RADIO' then
+    AControlClass := TRadioButton
+  else if sCtrlName = 'IMAGE' then
+    AControlClass := TImage;
+end;
+
+procedure TGUIForm1.ELGUIDesignerControlInserted(Sender: TObject);
+begin
+  frmGUIControls.jvGUIControls.ActivePage.DownIndex := 0;
+end;
+
+procedure TGUIForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
+begin
+  ShowWindow(Self.Handle, SW_HIDE);
+  CanClose := False;
+end;
+
+procedure TGUIForm1.ELGUIDesignerModified(Sender: TObject);
+begin
+  pLuaEditGUIForm.HasChanged := True;
+end;
+
+end.

+ 60 - 0
LuaEdit/GUIFormType.dfm

@@ -0,0 +1,60 @@
+object frmGUIFormType: TfrmGUIFormType
+  Left = 543
+  Top = 287
+  Width = 258
+  Height = 150
+  BorderIcons = [biSystemMenu]
+  Caption = 'Type of Script?'
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'MS Sans Serif'
+  Font.Style = []
+  OldCreateOrder = False
+  Position = poOwnerFormCenter
+  DesignSize = (
+    250
+    123)
+  PixelsPerInch = 96
+  TextHeight = 13
+  object Label1: TLabel
+    Left = 5
+    Top = 4
+    Width = 236
+    Height = 33
+    Anchors = [akLeft, akTop, akRight]
+    AutoSize = False
+    Caption = 'Please choose the type of script to associate with the GUI Form'
+    WordWrap = True
+  end
+  object Button1: TButton
+    Left = 170
+    Top = 92
+    Width = 75
+    Height = 25
+    Anchors = [akRight, akBottom]
+    Caption = '&Ok'
+    Default = True
+    TabOrder = 0
+    OnClick = Button1Click
+  end
+  object optLuaUnit: TRadioButton
+    Left = 16
+    Top = 43
+    Width = 113
+    Height = 17
+    Caption = 'Lua Unit'
+    Checked = True
+    TabOrder = 1
+    TabStop = True
+  end
+  object optLuaMacro: TRadioButton
+    Left = 16
+    Top = 67
+    Width = 113
+    Height = 17
+    Caption = 'Lua Macro'
+    TabOrder = 2
+  end
+end

+ 34 - 0
LuaEdit/GUIFormType.pas

@@ -0,0 +1,34 @@
+unit GUIFormType;
+
+interface
+
+uses
+  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+  Dialogs, StdCtrls;
+
+type
+  TfrmGUIFormType = class(TForm)
+    Button1: TButton;
+    Label1: TLabel;
+    optLuaUnit: TRadioButton;
+    optLuaMacro: TRadioButton;
+    procedure Button1Click(Sender: TObject);
+  private
+    { Private declarations }
+  public
+    { Public declarations }
+  end;
+
+var
+  frmGUIFormType: TfrmGUIFormType;
+
+implementation
+
+{$R *.dfm}
+
+procedure TfrmGUIFormType.Button1Click(Sender: TObject);
+begin
+  Self.Close;
+end;
+
+end.

+ 81 - 0
LuaEdit/GUIInspector.dfm

@@ -0,0 +1,81 @@
+object frmGUIInspector: TfrmGUIInspector
+  Left = 660
+  Top = 195
+  Width = 230
+  Height = 342
+  BorderStyle = bsSizeToolWin
+  Caption = 'GUI Inspector'
+  Color = clBtnFace
+  DockSite = True
+  DragKind = dkDock
+  DragMode = dmAutomatic
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'MS Sans Serif'
+  Font.Style = []
+  FormStyle = fsStayOnTop
+  OldCreateOrder = False
+  Position = poOwnerFormCenter
+  PixelsPerInch = 96
+  TextHeight = 13
+  object Panel1: TPanel
+    Left = 0
+    Top = 25
+    Width = 222
+    Height = 290
+    Align = alClient
+    BevelOuter = bvNone
+    TabOrder = 0
+    object TabControl1: TTabControl
+      Left = 0
+      Top = 0
+      Width = 222
+      Height = 290
+      Align = alClient
+      TabOrder = 0
+      Tabs.Strings = (
+        'Properties'
+        'Events')
+      TabIndex = 0
+      object ELGUIPropertyInspector: TELPropertyInspector
+        Left = 4
+        Top = 24
+        Width = 214
+        Height = 262
+        Splitter = 84
+        Align = alClient
+        TabOrder = 0
+        OnFilterProp = ELGUIPropertyInspectorFilterProp
+      end
+    end
+  end
+  object Panel2: TPanel
+    Left = 0
+    Top = 0
+    Width = 222
+    Height = 25
+    Align = alTop
+    BevelOuter = bvNone
+    TabOrder = 1
+    DesignSize = (
+      222
+      25)
+    object cboGUIElements: TComboBox
+      Left = 2
+      Top = 1
+      Width = 218
+      Height = 21
+      Style = csDropDownList
+      Anchors = [akLeft, akTop, akRight]
+      ItemHeight = 13
+      TabOrder = 0
+    end
+  end
+  object JvDockClient1: TJvDockClient
+    DirectDrag = False
+    DockStyle = frmLuaEditMain.jvDockVSNet
+    Left = 8
+    Top = 24
+  end
+end

+ 39 - 0
LuaEdit/GUIInspector.pas

@@ -0,0 +1,39 @@
+unit GUIInspector;
+
+interface
+
+uses
+  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+  Dialogs, JvComponent, JvDockControlForm, Grids, ELPropInsp, ComCtrls,
+  StdCtrls, ExtCtrls, TypInfo;
+
+type
+  TfrmGUIInspector = class(TForm)
+    JvDockClient1: TJvDockClient;
+    Panel1: TPanel;
+    Panel2: TPanel;
+    cboGUIElements: TComboBox;
+    TabControl1: TTabControl;
+    ELGUIPropertyInspector: TELPropertyInspector;
+    procedure ELGUIPropertyInspectorFilterProp(Sender: TObject; AInstance: TPersistent; APropInfo: PPropInfo; var AIncludeProp: Boolean);
+  private
+    { Private declarations }
+  public
+    { Public declarations }
+  end;
+
+var
+  frmGUIInspector: TfrmGUIInspector;
+
+implementation
+
+{$R *.dfm}
+
+procedure TfrmGUIInspector.ELGUIPropertyInspectorFilterProp(Sender: TObject; AInstance: TPersistent; APropInfo: PPropInfo; var AIncludeProp: Boolean);
+begin
+  // Filter out unsupported properties
+  if APropInfo.Name = 'Action' then
+    AIncludeProp := False;
+end;
+
+end.

BIN
LuaEdit/Graphics/DotNet_Style/ButtonCtrl.bmp


BIN
LuaEdit/Graphics/DotNet_Style/CheckBoxCtrl.bmp


BIN
LuaEdit/Graphics/DotNet_Style/Compile.bmp


BIN
LuaEdit/Graphics/DotNet_Style/EditCtrl.bmp


BIN
LuaEdit/Graphics/DotNet_Style/ErrorMsg.bmp


BIN
LuaEdit/Graphics/DotNet_Style/FileModified.bmp


BIN
LuaEdit/Graphics/DotNet_Style/FileNew.bmp


BIN
LuaEdit/Graphics/DotNet_Style/FileNotLoaded.bmp


BIN
LuaEdit/Graphics/DotNet_Style/FileOk.bmp


BIN
LuaEdit/Graphics/DotNet_Style/FileReadOnly.bmp


BIN
LuaEdit/Graphics/DotNet_Style/GUIInspector.bmp


BIN
LuaEdit/Graphics/DotNet_Style/HintMsg.bmp


BIN
LuaEdit/Graphics/DotNet_Style/ImageCtrl.bmp


BIN
LuaEdit/Graphics/DotNet_Style/LabelCtrl.bmp


BIN
LuaEdit/Graphics/DotNet_Style/MacroManager.bmp


BIN
LuaEdit/Graphics/DotNet_Style/NewGUIForm.bmp


BIN
LuaEdit/Graphics/DotNet_Style/NewGUIFormGrayed.bmp


BIN
LuaEdit/Graphics/DotNet_Style/NewMacro.bmp


BIN
LuaEdit/Graphics/DotNet_Style/NewMacroGrayed.bmp


BIN
LuaEdit/Graphics/DotNet_Style/NewText.bmp


BIN
LuaEdit/Graphics/DotNet_Style/NewTextGrayed.bmp


BIN
LuaEdit/Graphics/DotNet_Style/Profiler.bmp


BIN
LuaEdit/Graphics/DotNet_Style/RadioButtonCtrl.bmp


BIN
LuaEdit/Graphics/DotNet_Style/SelectCtrl.bmp


BIN
LuaEdit/Graphics/DotNet_Style/ToolBox.bmp


BIN
LuaEdit/Graphics/DotNet_Style/UnitGrayed.bmp


BIN
LuaEdit/Graphics/DotNet_Style/WarningMsg.bmp


+ 711 - 0
LuaEdit/LEMacros.pas

@@ -0,0 +1,711 @@
+////////////////////////////////////////////////////////////////////////////////
+// IMPORTANT: View the complexity here since there is no concrete (visual)
+//            quick and reliable way to see what's in and out of the functions,
+//            please comment properly using the current function's comment
+//            syntax.
+////////////////////////////////////////////////////////////////////////////////
+
+unit LEMacros;
+
+interface
+
+uses lua, lualib, lauxlib, Forms, SysUtils, LuaUtils, Misc, SynEdit,
+     LuaEditMessages, Classes, Registry, Windows;
+
+procedure LERegisterToLua(L: Plua_State);
+
+implementation
+
+uses Main;
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// LuaEdit related functions
+////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////////////
+// Desc: This function open a file using LuaEdit's open file dialog
+// In:   None
+// Out:  (1) True if the operation ended successfully. False if canceled,
+//           unavailable (disabled) or failed.
+//
+// 14/05/2006 - Jean-Francois Goulet
+////////////////////////////////////////////////////////////////////////////////
+function LuaLEOpenFile(L: Plua_State): Integer; cdecl;
+var
+  FilesName: TStringList;
+  x: Integer;
+begin
+  // Initialize variables
+  FilesName := TStringList.Create;
+
+  // Retrieve all files' name (if any...)
+  for x := 1 to lua_gettop(L) do
+    if lua_type(L, x) = LUA_TSTRING then
+      FilesName.Add(StrPas(lua_tostring(L, x)));
+
+  // Return the luaedit version as a string
+  lua_pushboolean(L, Integer(frmLuaEditMain.DoOpenFileExecute(FilesName)));
+
+  // Free variables
+  FilesName.Free;
+
+  // Return in Delphi the number of argument pushed on the stack
+  Result := 1;
+end;
+
+////////////////////////////////////////////////////////////////////////////////
+// Desc: This function open a project using LuaEdit's open project dialog
+// In:   None
+// Out:  (1) True if the operation ended successfully. False if canceled,
+//           unavailable (disabled) or failed.
+//
+// 14/05/2006 - Jean-Francois Goulet
+////////////////////////////////////////////////////////////////////////////////
+function LuaLEOpenProject(L: Plua_State): Integer; cdecl;
+begin
+  // Return the luaedit version as a string
+  lua_pushboolean(L, Integer(frmLuaEditMain.DoOpenProjectExecute()));
+
+  // Return in Delphi the number of argument pushed on the stack
+  Result := 1;
+end;
+
+////////////////////////////////////////////////////////////////////////////////
+// Desc: This function save all opened files
+// In:   None
+// Out:  (1) True if the operation ended successfully. False if canceled,
+//           unavailable (disabled) or failed.
+//
+// 14/05/2006 - Jean-Francois Goulet
+////////////////////////////////////////////////////////////////////////////////
+function LuaLESaveAll(L: Plua_State): Integer; cdecl;
+begin
+  // Return the luaedit version as a string
+  lua_pushboolean(L, Integer(frmLuaEditMain.DoSaveAllExecute()));
+
+  // Return in Delphi the number of argument pushed on the stack
+  Result := 1;
+end;
+
+////////////////////////////////////////////////////////////////////////////////
+// Desc: This function save the current active project as...
+// In:   None
+// Out:  (1) True if the operation ended successfully. False if canceled,
+//           unavailable (disabled) or failed.
+//
+// 14/05/2006 - Jean-Francois Goulet
+////////////////////////////////////////////////////////////////////////////////
+function LuaLESavePrjAs(L: Plua_State): Integer; cdecl;
+begin
+  // Return the luaedit version as a string
+  lua_pushboolean(L, Integer(frmLuaEditMain.DoSaveProjectAsExecute()));
+
+  // Return in Delphi the number of argument pushed on the stack
+  Result := 1;
+end;
+
+////////////////////////////////////////////////////////////////////////////////
+// Desc: This function save the currently opened unit as...
+// In:   None
+// Out:  (1) True if the operation ended successfully. False if canceled,
+//           unavailable (disabled) or failed.
+//
+// 14/05/2006 - Jean-Francois Goulet
+////////////////////////////////////////////////////////////////////////////////
+function LuaLESaveUnitAs(L: Plua_State): Integer; cdecl;
+begin
+  // Return the luaedit version as a string
+  lua_pushboolean(L, Integer(frmLuaEditMain.DoSaveAsExecute()));
+
+  // Return in Delphi the number of argument pushed on the stack
+  Result := 1;
+end;
+
+////////////////////////////////////////////////////////////////////////////////
+// Desc: This function save the currently opened unit
+// In:   None
+// Out:  (1) True if the operation ended successfully. False if canceled,
+//           unavailable (disabled) or failed.
+//
+// 14/05/2006 - Jean-Francois Goulet
+////////////////////////////////////////////////////////////////////////////////
+function LuaLESaveUnit(L: Plua_State): Integer; cdecl;
+begin
+  // Return the luaedit version as a string
+  lua_pushboolean(L, Integer(frmLuaEditMain.DoSaveExecute()));
+
+  // Return in Delphi the number of argument pushed on the stack
+  Result := 1;
+end;
+
+////////////////////////////////////////////////////////////////////////////////
+// Desc: This function return informations about the specified unit
+// In:   (1) [OPTIONAL] The index of the unit from which to retrieve informations
+// Out:  (1) A lua table formatted this way:
+//                t = {}
+//                t["Name"]           = "Unit1.lua"
+//                t["Path"]           = "C:\\Program Files\\LuaEdit\\Unit1.lua"
+//                t["IsReadOnly"]     = False
+//                t["IsNew"]          = False
+//                t["HasChanged"]     = True
+//                t["Text"]           = {}
+//                t["Text"]["Count"]  = 3
+//                t["Text"][-1]       = "print(123)??print(456)??print(789)"
+//                t["Text"][0]        = "print(123)"
+//                t["Text"][1]        = "print(456)"
+//                t["Text"][2]        = "print(789)"
+//
+// 14/05/2006 - Jean-Francois Goulet
+////////////////////////////////////////////////////////////////////////////////
+function LuaLEGetUnit(L: Plua_State): Integer; cdecl;
+var
+  Index, x: Integer;
+  pLuaUnit: TLuaEditUnit;
+begin
+  // Retrieve SAFELY the first parameter
+  if lua_type(L, -1) = LUA_TNUMBER then
+    Index := Trunc(lua_tonumber(L, -1))
+  else if lua_gettop(L) = 0 then
+    Index := -1;
+
+  // Retrieve currently selected tab index
+  if Index = -1 then
+    if Assigned(frmLuaEditMain.jvUnitBar.SelectedTab) then
+      Index := frmLuaEditMain.jvUnitBar.SelectedTab.Index;
+
+  if ((Index >= 0) and (Index < frmLuaEditMain.jvUnitBar.Tabs.Count)) then
+  begin
+    // Verify availability of the data at the specified index
+    if Assigned(frmLuaEditMain.jvUnitBar.Tabs[Index]) then
+    begin
+      if Assigned(frmLuaEditMain.jvUnitBar.Tabs[Index].Data) then
+      begin
+        // Retrieve unit data
+        pLuaUnit := TLuaEditUnit(frmLuaEditMain.jvUnitBar.Tabs[Index].Data);
+
+        // Create table on the lua stack which will be returned to lua
+        lua_newtable(L);
+
+        // Push "Name" data
+        lua_pushstring(L, 'Name');
+        lua_pushstring(L, PChar(pLuaUnit.Name));
+        lua_settable(L, -3);
+
+        // Push "Path" data
+        lua_pushstring(L, 'Path');
+        lua_pushstring(L, PChar(pLuaUnit.Path));
+        lua_settable(L, -3);
+
+        // Push "IsLoaded" data
+        lua_pushstring(L, 'IsLoaded');
+        lua_pushboolean(L, Integer(pLuaUnit.IsLoaded));
+        lua_settable(L, -3);
+
+        // Push "IsReadOnly" data
+        lua_pushstring(L, 'IsReadOnly');
+        lua_pushboolean(L, Integer(pLuaUnit.IsReadOnly));
+        lua_settable(L, -3);
+
+        // Push "IsNew" data
+        lua_pushstring(L, 'IsNew');
+        lua_pushboolean(L, Integer(pLuaUnit.IsNew));
+        lua_settable(L, -3);
+
+        // Push "HasChanged" data
+        lua_pushstring(L, 'HasChanged');
+        lua_pushboolean(L, Integer(pLuaUnit.HasChanged));
+        lua_settable(L, -3);
+
+        // Push "Text" data
+        lua_pushstring(L, 'Text');
+        lua_newtable(L);
+
+        // Push "Text"."Count" data
+        lua_pushstring(L, 'Count');
+        lua_pushnumber(L, pLuaUnit.synUnit.Lines.Count);
+        lua_settable(L, -3);
+
+        // Push "Text".-1 data
+        lua_pushnumber(L, -1);
+        lua_pushstring(L, PChar(pLuaUnit.synUnit.Text));
+        lua_settable(L, -3);
+
+        // Push "Text".x data
+        for x := 0 to pLuaUnit.synUnit.Lines.Count - 1 do
+        begin
+          lua_pushnumber(L, x);
+          lua_pushstring(L, PChar(pLuaUnit.synUnit.Lines[x]));
+          lua_settable(L, -3);
+        end;
+
+        // Push the "Text" table
+        lua_settable(L, -3);
+      end;
+    end;
+  end;
+
+  // Return nil if no unit associated to the given index was found
+  if not Assigned(pLuaUnit) then
+    lua_pushnil(L);
+
+  // Return in Delphi the number of argument pushed on the stack
+  Result := 1;
+end;
+
+////////////////////////////////////////////////////////////////////////////////
+// Desc: This function return informations about the current active project
+// In:   None
+// Out:  (1) A lua table formatted this way:
+//                t = {}
+//                t["Name"]             = "Project1"
+//                t["Path"]             = "C:\\Program Files\\LuaEdit\\Project1.lpr"
+//                t["Initializer"]      = "C:\\Initializer.dll"
+//                t["RemoteIP"]         = "192.168.0.1"
+//                t["RemoteDirectory"]  = "//RemoteDir//Bin//"
+//                t["RuntimeDirectory"] = "C:\\Program Files\\LuaEdit\\"
+//                t["TargetLuaUnit"]    = "C:\\Program Files\\LuaEdit\\Unit1.lua"
+//                t["CompileDirectory"] = "C:\\Bin\\"
+//                t["CompileExtension"] = ".luac"
+//                t["AutoIncRevNumber"] = False
+//                t["IsReadOnly"]       = False
+//                t["IsNew"]            = False
+//                t["HasChanged"]       = True
+//                t["VersionMajor"]    = 1
+//                t["VersionMinor"]    = 0
+//                t["VersionRelease"]  = 1
+//                t["VersionRevision"] = 0
+//                t["RemotePort"]      = 6666
+//                t["ConnectTimeOut"]  = 10
+//                t["Files"]             = {}
+//                t["Files"]["Count"]    = 2
+//                t["Files"][0]          = "C:\\Program Files\\LuaEdit\\Unit1.lua"
+//                t["Files"][1]          = "C:\\Program Files\\LuaEdit\\Unit2.lua"
+//
+// 14/05/2006 - Jean-Francois Goulet
+////////////////////////////////////////////////////////////////////////////////
+function LuaLEGetActivePrj(L: Plua_State): Integer; cdecl;
+var
+  x: Integer;
+  pLuaUnit: TLuaEditUnit;
+begin
+  // Verify availability of the data
+  if Assigned(ActiveProject) then
+  begin
+    // Create table on the lua stack which will be returned to lua
+    lua_newtable(L);
+
+    // Push "Name" data
+    lua_pushstring(L, 'Name');
+    lua_pushstring(L, PChar(ActiveProject.Name));
+    lua_settable(L, -3);
+
+    // Push "Path" data
+    lua_pushstring(L, 'Path');
+    lua_pushstring(L, PChar(ActiveProject.Path));
+    lua_settable(L, -3);
+
+    // Push "Initializer" data
+    lua_pushstring(L, 'Initializer');
+    lua_pushstring(L, PChar(ActiveProject.sInitializer));
+    lua_settable(L, -3);
+
+    // Push "RemoteIP" data
+    lua_pushstring(L, 'RemoteIP');
+    lua_pushstring(L, PChar(ActiveProject.sRemoteIP));
+    lua_settable(L, -3);
+
+    // Push "RemoteDirectory" data
+    lua_pushstring(L, 'RemoteDirectory');
+    lua_pushstring(L, PChar(ActiveProject.sRemoteDirectory));
+    lua_settable(L, -3);
+
+    // Push "RuntimeDirectory" data
+    lua_pushstring(L, 'RuntimeDirectory');
+    lua_pushstring(L, PChar(ActiveProject.sRuntimeDirectory));
+    lua_settable(L, -3);
+
+    // Push "TargetLuaUnit" data
+    lua_pushstring(L, 'TargetLuaUnit');
+    lua_pushstring(L, PChar(ActiveProject.sTargetLuaUnit));
+    lua_settable(L, -3);
+
+    // Push "CompileDirectory" data
+    lua_pushstring(L, 'CompileDirectory');
+    lua_pushstring(L, PChar(ActiveProject.sCompileDirectory));
+    lua_settable(L, -3);
+
+    // Push "CompileExtension" data
+    lua_pushstring(L, 'CompileExtension');
+    lua_pushstring(L, PChar(ActiveProject.sCompileExtension));
+    lua_settable(L, -3);
+
+    // Push "AutoIncRevNumber" data
+    lua_pushstring(L, 'AutoIncRevNumber');
+    lua_pushboolean(L, Integer(ActiveProject.AutoIncRevNumber));
+    lua_settable(L, -3);
+
+    // Push "IsReadOnly" data
+    lua_pushstring(L, 'IsReadOnly');
+    lua_pushboolean(L, Integer(ActiveProject.IsReadOnly));
+    lua_settable(L, -3);
+
+    // Push "IsNew" data
+    lua_pushstring(L, 'IsNew');
+    lua_pushboolean(L, Integer(ActiveProject.IsNew));
+    lua_settable(L, -3);
+
+    // Push "HasChanged" data
+    lua_pushstring(L, 'HasChanged');
+    lua_pushboolean(L, Integer(ActiveProject.HasChanged));
+    lua_settable(L, -3);
+    
+    // Push "VersionMajor" data
+    lua_pushstring(L, 'VersionMajor');
+    lua_pushnumber(L, ActiveProject.iVersionMajor);
+    lua_settable(L, -3);
+
+    // Push "VersionMinor" data
+    lua_pushstring(L, 'VersionMinor');
+    lua_pushnumber(L, ActiveProject.iVersionMinor);
+    lua_settable(L, -3);
+
+    // Push "VersionRelease" data
+    lua_pushstring(L, 'VersionRelease');
+    lua_pushnumber(L, ActiveProject.iVersionRelease);
+    lua_settable(L, -3);
+
+    // Push "VersionRevision" data
+    lua_pushstring(L, 'VersionRevision');
+    lua_pushnumber(L, ActiveProject.iVersionRevision);
+    lua_settable(L, -3);
+
+    // Push "RemotePort" data
+    lua_pushstring(L, 'RemotePort');
+    lua_pushnumber(L, ActiveProject.iRemotePort);
+    lua_settable(L, -3);
+
+    // Push "ConnectTimeOut" data
+    lua_pushstring(L, 'ConnectTimeOut');
+    lua_pushnumber(L, ActiveProject.iConnectTimeOut);
+    lua_settable(L, -3);
+    
+    // Push "Files" data
+    lua_pushstring(L, 'Files');
+    lua_newtable(L);
+
+    // Push "Files"."Count" data
+    lua_pushstring(L, 'Count');
+    lua_pushnumber(L, ActiveProject.lstUnits.Count);
+    lua_settable(L, -3);
+
+    // Push "Files".x data
+    for x := 0 to ActiveProject.lstUnits.Count - 1 do
+    begin
+      lua_pushnumber(L, x);
+      lua_pushstring(L, PChar(TLuaEditUnit(ActiveProject.lstUnits[x]).Path));
+      lua_settable(L, -3);
+    end;
+
+    // Push the "Files" table
+    lua_settable(L, -3);
+  end;
+
+  // Return nil if no unit associated to the given index was found
+  if not Assigned(pLuaUnit) then
+    lua_pushnil(L);
+
+  // Return in Delphi the number of argument pushed on the stack
+  Result := 1;
+end;
+
+////////////////////////////////////////////////////////////////////////////////
+// Desc: This function print the given message in LuaEdit's message window
+// In:   (1) The message to print
+//       (2) The type of message to print (EG: 1 = 'hint', 2 = 'warning', 3 = 'error')
+// Out:  (1) The complete string as displayed in LuaEdit's message window or nil
+//
+// 14/05/2006 - Jean-Francois Goulet
+////////////////////////////////////////////////////////////////////////////////
+function LuaLEPrint(L: PLua_State): Integer; cdecl;
+var
+  Msg, FullMsg: String;
+  MsgType: Integer;
+begin
+  // Retrieve SAFELY the second parameter (of the first if there is only one argument)
+  if lua_type(L, -1) = LUA_TNUMBER then
+  begin
+    MsgType := Trunc(lua_tonumber(L, -1));
+
+    // Retrieve SAFELY the first parameter (or assign default message type if only one argument was supplied)
+    if lua_type(L, -2) <> LUA_TSTRING then
+    begin
+      Msg := lua_tostring(L, -1);
+      MsgType := LUAEDIT_HINT_MSG;
+    end
+    else
+      Msg := lua_tostring(L, -2);
+
+    // Show message in LuaEdit's message window
+    FullMsg := Msg + ' - ' + DateTimeToStr(Now);
+    lua_pushstring(L, PChar(FullMsg));
+    frmLuaEditMessages.Put(FullMsg, MsgType);
+  end
+  else
+    lua_pushnil(L);
+
+  // Return in Delphi the number of argument pushed on the stack
+  Result := 1;
+end;
+
+////////////////////////////////////////////////////////////////////////////////
+// Desc: This function return LuaEdit's version on the stack
+// In:   None
+// Out:  (1) A string containing LuaEdit's version
+//
+// 14/05/2006 - Jean-Francois Goulet
+////////////////////////////////////////////////////////////////////////////////
+function LuaLEGetVersion(L: Plua_State): Integer; cdecl;
+begin
+  // Return the luaedit version as a string
+  lua_pushstring(L, GetFileVersion(PChar(Application.ExeName)));
+
+  // Return in Delphi the number of argument pushed on the stack
+  Result := 1;
+end;
+
+////////////////////////////////////////////////////////////////////////////////
+// Desc: This function return LuaEdit's product name on the stack
+// In:   None
+// Out:  (1) A string containing LuaEdit's product name
+//
+// 14/05/2006 - Jean-Francois Goulet
+////////////////////////////////////////////////////////////////////////////////
+function LuaLEGetProductName(L: Plua_State): Integer; cdecl;
+begin
+  // Return the luaedit product name
+  lua_pushstring(L, 'LuaEdit');
+
+  // Return in Delphi the number of argument pushed on the stack
+  Result := 1;
+end;
+
+////////////////////////////////////////////////////////////////////////////////
+// Desc: This function exit LuaEdit
+// In:   None
+// Out:  None
+//
+// 14/05/2006 - Jean-Francois Goulet
+////////////////////////////////////////////////////////////////////////////////
+function LuaLEExit(L: PLua_State): Integer; cdecl;
+begin
+  // Safely exit from LuaEdit
+  frmLuaEditMain.DoExitExecute;
+
+  // Return in Delphi the number of argument pushed on the stack
+  Result := 0;
+end;
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Win32 related functions
+////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////////////
+// Desc: This reads the registry given its key and value(s)
+// In:   (1) The root key to open
+//       (2) The registry key to open
+//       (3) The value #1 to read from the specified key
+//       (4) The value #2 to read from the specified key
+//       (...) The value #X to read from the specified key
+// Out:  (1) The registry value's value
+//
+// 30/09/2006 - Jean-Francois Goulet
+////////////////////////////////////////////////////////////////////////////////
+function LuaLERegRead(L: PLua_State): Integer; cdecl;
+var
+  pReg: TRegistry;
+  x: Integer;
+  RootKeyTemp, Key, ValueName: String;
+  RootKey: HKEY;
+begin
+  Result := 0;
+
+  // Retrieve SAFELY the first parameter
+  if lua_type(L, 1) = LUA_TSTRING then
+  begin
+    RootKeyTemp := UpperCase(lua_tostring(L, 1));
+
+    // Determine the root key
+    if RootKeyTemp = 'HKLM' then
+      RootKey := HKEY_LOCAL_MACHINE
+    else if RootKeyTemp = 'HKCR' then
+      RootKey := HKEY_CLASSES_ROOT
+    else if RootKeyTemp = 'HKCU' then
+      RootKey := HKEY_CURRENT_USER
+    else if RootKeyTemp = 'HKU' then
+      RootKey := HKEY_USERS
+    else if RootKeyTemp = 'HKCC' then
+      RootKey := HKEY_CURRENT_CONFIG;
+
+    // Retrieve SAFELY the second parameter
+    if lua_type(L, 2) = LUA_TSTRING then
+    begin
+      Key := lua_tostring(L, 2);
+      pReg := TRegistry.Create;
+      pReg.RootKey := RootKey;
+
+      if pReg.OpenKey(Key, False) then
+      begin
+        for x := 3 to lua_gettop(L) do
+        begin
+          // Increment number of argument pushed on the stack
+          Inc(Result);
+
+          if lua_type(L, x) = LUA_TSTRING then
+          begin
+            ValueName := lua_tostring(L, x);
+
+            if pReg.ValueExists(ValueName) then
+            begin
+              case pReg.GetDataType(ValueName) of
+                rdString, rdExpandString: lua_pushstring(L, PChar(pReg.ReadString(ValueName)));
+                rdInteger: lua_pushnumber(L, pReg.ReadFloat(ValueName));
+              else
+                lua_pushnil(L);
+              end;
+            end
+            else
+              lua_pushnil(L);
+          end
+          else
+            lua_pushnil(L);
+        end;
+      end;
+
+      pReg.Free;
+    end;
+  end;
+end;
+
+////////////////////////////////////////////////////////////////////////////////
+// Desc: This write the registry given its key and value
+// In:   (1) The root key to open
+//       (2) The registry key to open
+//       (3) The value name to write
+//       (4) The value's value
+// Out:  (1) Return true if successful. Otherwise return nil.
+//
+// 30/09/2006 - Jean-Francois Goulet
+////////////////////////////////////////////////////////////////////////////////
+function LuaLERegWrite(L: PLua_State): Integer; cdecl;
+var
+  pReg: TRegistry;
+  x: Integer;
+  RootKeyTemp, Key, ValueName: String;
+  RootKey: HKEY;
+begin
+  // Retrieve SAFELY the first parameter
+  if lua_type(L, 1) = LUA_TSTRING then
+  begin
+    RootKeyTemp := UpperCase(lua_tostring(L, 1));
+
+    // Determine the root key
+    if RootKeyTemp = 'HKLM' then
+      RootKey := HKEY_LOCAL_MACHINE
+    else if RootKeyTemp = 'HKCR' then
+      RootKey := HKEY_CLASSES_ROOT
+    else if RootKeyTemp = 'HKCU' then
+      RootKey := HKEY_CURRENT_USER
+    else if RootKeyTemp = 'HKU' then
+      RootKey := HKEY_USERS
+    else if RootKeyTemp = 'HKCC' then
+      RootKey := HKEY_CURRENT_CONFIG;
+
+    // Retrieve SAFELY the second parameter
+    if lua_type(L, 2) = LUA_TSTRING then
+    begin
+      Key := lua_tostring(L, 2);
+      pReg := TRegistry.Create;
+      pReg.RootKey := RootKey;
+      pReg.OpenKey(Key, True);
+
+      if lua_gettop(L) >= 4 then
+      begin
+        if lua_type(L, 4) = LUA_TSTRING then
+        begin
+          ValueName := lua_tostring(L, 4);
+
+          case lua_type(L, 5) of
+            LUA_TSTRING: pReg.WriteString(ValueName, lua_tostring(L, 5));
+            LUA_TNUMBER: pReg.WriteFloat(ValueName, lua_tonumber(L, 5));
+          end;
+        end;
+      end;
+
+      pReg.Free;
+    end;
+  end;
+
+  // Return in Delphi the number of argument pushed on the stack
+  Result := 1;
+end;
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Lua state registration related functions
+////////////////////////////////////////////////////////////////////////////////
+
+// This function register in the given lua state all luaedit related function
+// to allow to the user some interface customization. Kind of like macros but
+// using lua.
+procedure LERegisterToLua(L: Plua_State);
+const
+  LETableName = 'luaedit';
+begin
+  // Open basic lua libraries
+  lua_baselibopen(L);
+  lua_tablibopen(L);
+  lua_strlibopen(L);
+  lua_iolibopen(L);
+  lua_mathlibopen(L);
+  lua_dblibopen(L);
+
+  // LuaEdit's core system functions
+  LuaRegister(L, LETableName+'.getver', LuaLEGetVersion);
+  LuaRegister(L, LETableName+'.getproductname', LuaLEGetProductName);
+  LuaRegister(L, LETableName+'.exit', LuaLEExit);
+
+  // LuaEdit's interfaces functions
+  LuaRegister(L, LETableName+'.print', LuaLEPrint);
+
+  // LuaEdit's file manipulation functions
+  LuaRegister(L, LETableName+'.openfile', LuaLEOpenFile);
+  LuaRegister(L, LETableName+'.openprj', LuaLEOpenProject);
+  LuaRegister(L, LETableName+'.saveall', LuaLESaveAll);
+  LuaRegister(L, LETableName+'.saveprjas', LuaLESavePrjAs);
+  LuaRegister(L, LETableName+'.saveunit', LuaLESaveUnit);
+  LuaRegister(L, LETableName+'.saveunitas', LuaLESaveUnitAs);
+  LuaRegister(L, LETableName+'.getunit', LuaLEGetUnit);
+  LuaRegister(L, LETableName+'.getactiveprj', LuaLEGetActivePrj);
+
+  // Win32 system functions
+  LuaRegister(L, LETableName+'.regread', LuaLERegRead);
+  LuaRegister(L, LETableName+'.regwrite', LuaLERegWrite);
+
+  // Register variables
+  lua_getglobal(L, LETableName);
+
+  // Push LuaEdit's version
+  lua_pushstring(L, '_VERSION');
+  lua_pushstring(L, _LuaEditVersion);
+  lua_settable(L, -3);
+end;
+
+end.

+ 293 - 0
LuaEdit/MacroManager.dfm

@@ -0,0 +1,293 @@
+object frmMacroManager: TfrmMacroManager
+  Left = 382
+  Top = 233
+  BorderIcons = [biSystemMenu]
+  BorderStyle = bsSingle
+  Caption = 'Macro Manager'
+  ClientHeight = 407
+  ClientWidth = 458
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'MS Sans Serif'
+  Font.Style = []
+  FormStyle = fsStayOnTop
+  OldCreateOrder = False
+  Position = poOwnerFormCenter
+  OnShow = FormShow
+  DesignSize = (
+    458
+    407)
+  PixelsPerInch = 96
+  TextHeight = 13
+  object sbtnAdd: TSpeedButton
+    Left = 56
+    Top = 208
+    Width = 23
+    Height = 22
+    Hint = 'Create New Macro'
+    Glyph.Data = {
+      36030000424D3603000000000000360000002800000010000000100000000100
+      1800000000000003000000000000000000000000000000000000FF00FFFF00FF
+      FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00
+      FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF
+      00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF
+      0000000000000000000000000000000000000000000000000000000000000000
+      00FF00FFFF00FFFF00FFFF00FFFF00FF000000FFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FF00FFFF00FFFF00FFFF00FFFF00FF
+      000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000
+      00FF00FFFF00FFFF00FFFF00FFFF00FF000000FFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FF00FFFF00FFFF00FFFF00FFFF00FF
+      000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000
+      00FF00FFFF00FFFF00FFFF00FFFF00FF000000FFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FF00FFFF00FFFF00FFFF00FFFF00FF
+      000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000
+      00FF00FFFF00FFFF00FFFF00FFFF00FF000000FFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FF00FFFF00FFFF00FFFF00FFFF00FF
+      000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000
+      00FF00FFFF00FFFF00FFFF00FFFF00FF000000FFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFF000000000000000000000000FF00FFFF00FFFF00FFFF00FFFF00FF
+      000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFF000000FF00
+      FFFF00FFFF00FFFF00FFFF00FFFF00FF000000FFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFF000000000000FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF
+      000000000000000000000000000000000000000000000000FF00FFFF00FFFF00
+      FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF
+      00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF}
+    OnClick = sbtnAddClick
+  end
+  object sbtnDelete: TSpeedButton
+    Left = 8
+    Top = 208
+    Width = 23
+    Height = 22
+    Hint = 'Delete Selected Macro'
+    Glyph.Data = {
+      36030000424D3603000000000000360000002800000010000000100000000100
+      1800000000000003000000000000000000000000000000000000FF00FFFF00FF
+      FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00
+      FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF
+      00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF
+      FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00
+      FFFF00FF000080FF00FFFF00FFFF00FFFF00FFFF00FF000080FFFFFFFF00FFFF
+      00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF
+      FF00FF000080000080000080FFFFFFFF00FFFF00FFFF00FFFF00FFFF00FFFF00
+      FF000080FFFFFFFF00FFFF00FFFF00FFFF00FF000080000080000080FFFFFFFF
+      00FFFF00FFFF00FFFF00FFFF00FF000080FFFFFFFF00FFFF00FFFF00FFFF00FF
+      FF00FFFF00FF000080000080000080FFFFFFFF00FFFF00FFFF00FF0000800000
+      80FFFFFFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF00008000008000
+      0080FFFFFFFF00FF000080000080FFFFFFFF00FFFF00FFFF00FFFF00FFFF00FF
+      FF00FFFF00FFFF00FFFF00FF000080000080000080000080000080FFFFFFFF00
+      FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF00
+      0080000080000080FFFFFFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF
+      FF00FFFF00FFFF00FFFF00FF000080000080000080000080000080FFFFFFFF00
+      FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF00008000008000
+      0080FFFFFFFF00FF000080FFFFFFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF
+      FF00FF000080000080000080000080FFFFFFFF00FFFF00FFFF00FF0000800000
+      80FFFFFFFF00FFFF00FFFF00FFFF00FF000080000080000080000080FFFFFFFF
+      00FFFF00FFFF00FFFF00FFFF00FF000080000080FFFFFFFF00FFFF00FFFF00FF
+      000080000080FFFFFFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00
+      FF000080000080FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF
+      00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF}
+    OnClick = sbtnDeleteClick
+  end
+  object sbtnSave: TSpeedButton
+    Left = 32
+    Top = 208
+    Width = 23
+    Height = 22
+    Hint = 'Save Changes to Selected Macro'
+    Glyph.Data = {
+      36030000424D3603000000000000360000002800000010000000100000000100
+      1800000000000003000000000000000000000000000000000000FF00FFFF00FF
+      FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00
+      FFFF00FFFF00FFFF00FFFF00FFFF00FF42424242424242424242424242424242
+      4242424242424242424242424242424242424242424242FF00FFFF00FF424242
+      429D9D429D9D424242424242424242424242424242424242CECECECECECE4242
+      42429D9D424242FF00FFFF00FF424242429D9D429D9D42424242424242424242
+      4242424242424242CECECECECECE424242429D9D424242FF00FFFF00FF424242
+      429D9D429D9D424242424242424242424242424242424242CECECECECECE4242
+      42429D9D424242FF00FFFF00FF424242429D9D429D9D42424242424242424242
+      4242424242424242424242424242424242429D9D424242FF00FFFF00FF424242
+      429D9D429D9D429D9D429D9D429D9D429D9D429D9D429D9D429D9D429D9D429D
+      9D429D9D424242FF00FFFF00FF424242429D9D429D9D42424242424242424242
+      4242424242424242424242424242429D9D429D9D424242FF00FFFF00FF424242
+      429D9D424242CECECECECECECECECECECECECECECECECECECECECECECECE4242
+      42429D9D424242FF00FFFF00FF424242429D9D424242CECECECECECECECECECE
+      CECECECECECECECECECECECECECE424242429D9D424242FF00FFFF00FF424242
+      429D9D424242CECECECECECECECECECECECECECECECECECECECECECECECE4242
+      42429D9D424242FF00FFFF00FF424242429D9D424242CECECECECECECECECECE
+      CECECECECECECECECECECECECECE424242429D9D424242FF00FFFF00FF424242
+      429D9D424242CECECECECECECECECECECECECECECECECECECECECECECECE4242
+      42424242424242FF00FFFF00FF424242429D9D424242CECECECECECECECECECE
+      CECECECECECECECECECECECECECE424242CECECE424242FF00FFFF00FF424242
+      4242424242424242424242424242424242424242424242424242424242424242
+      42424242424242FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF
+      00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF}
+    OnClick = sbtnSaveClick
+  end
+  object GroupBox1: TGroupBox
+    Left = 8
+    Top = 8
+    Width = 441
+    Height = 193
+    Caption = 'Macro Informations'
+    TabOrder = 2
+    object Label1: TLabel
+      Left = 16
+      Top = 72
+      Width = 50
+      Height = 13
+      Caption = 'File Name:'
+    end
+    object Label2: TLabel
+      Left = 16
+      Top = 120
+      Width = 69
+      Height = 13
+      Caption = 'Menu Caption:'
+    end
+    object Label3: TLabel
+      Left = 352
+      Top = 120
+      Width = 43
+      Height = 13
+      Caption = 'Shortcut:'
+    end
+    object Label4: TLabel
+      Left = 16
+      Top = 24
+      Width = 31
+      Height = 13
+      Caption = 'Name:'
+    end
+    object cboShortcut: TComboBox
+      Left = 352
+      Top = 136
+      Width = 81
+      Height = 21
+      Style = csDropDownList
+      ItemHeight = 13
+      TabOrder = 4
+      OnClick = cboShortcutClick
+      Items.Strings = (
+        '[None]'
+        'Shift+0'
+        'Shift+1'
+        'Shift+2'
+        'Shift+3'
+        'Shift+4'
+        'Shift+5'
+        'Shift+6'
+        'Shift+7'
+        'Shift+8'
+        'Shift+9')
+    end
+    object txtCaption: TEdit
+      Left = 16
+      Top = 136
+      Width = 329
+      Height = 21
+      TabOrder = 3
+      OnChange = txtCaptionChange
+    end
+    object chkDebug: TCheckBox
+      Left = 16
+      Top = 168
+      Width = 153
+      Height = 17
+      Caption = 'Debug mode'
+      TabOrder = 5
+      OnClick = chkDebugClick
+    end
+    object txtFileName: TEdit
+      Left = 16
+      Top = 89
+      Width = 393
+      Height = 21
+      TabOrder = 1
+      OnChange = txtFileNameChange
+    end
+    object btnBrowseFile: TButton
+      Left = 414
+      Top = 91
+      Width = 19
+      Height = 17
+      Caption = '...'
+      TabOrder = 2
+      OnClick = btnBrowseFileClick
+    end
+    object txtName: TEdit
+      Left = 16
+      Top = 41
+      Width = 417
+      Height = 21
+      TabOrder = 0
+      OnChange = txtNameChange
+    end
+  end
+  object Button2: TButton
+    Left = 375
+    Top = 377
+    Width = 75
+    Height = 25
+    Anchors = [akRight, akBottom]
+    Cancel = True
+    Caption = '&Close'
+    Default = True
+    ModalResult = 1
+    TabOrder = 1
+  end
+  object vstMacros: TVirtualStringTree
+    Left = 8
+    Top = 232
+    Width = 441
+    Height = 137
+    Header.AutoSizeIndex = 0
+    Header.Font.Charset = DEFAULT_CHARSET
+    Header.Font.Color = clWindowText
+    Header.Font.Height = -11
+    Header.Font.Name = 'MS Sans Serif'
+    Header.Font.Style = []
+    Header.Options = [hoColumnResize, hoDrag, hoVisible]
+    ScrollBarOptions.AlwaysVisible = True
+    TabOrder = 0
+    TreeOptions.PaintOptions = [toShowButtons, toShowDropmark, toThemeAware, toUseBlendedImages]
+    TreeOptions.SelectionOptions = [toFullRowSelect]
+    OnFocusChanged = vstMacrosFocusChanged
+    OnFocusChanging = vstMacrosFocusChanging
+    OnGetText = vstMacrosGetText
+    OnGetNodeDataSize = vstMacrosGetNodeDataSize
+    Columns = <
+      item
+        Position = 0
+        Width = 100
+        WideText = 'Name'
+      end
+      item
+        Position = 1
+        Width = 171
+        WideText = 'File Name'
+      end
+      item
+        Position = 2
+        Width = 100
+        WideText = 'Caption'
+      end
+      item
+        Position = 3
+        WideText = 'Shotcut'
+      end
+      item
+        Position = 4
+        WideText = 'Mode'
+      end>
+  end
+  object odlgSelectFile: TOpenDialog
+    Filter = 'LuaEdit Macros (*.lmc)|*.lmc'
+    InitialDir = 'C:\'
+    Title = 'Select a LuaEdit Macro File...'
+    Left = 12
+    Top = 376
+  end
+end

+ 404 - 0
LuaEdit/MacroManager.pas

@@ -0,0 +1,404 @@
+unit MacroManager;
+
+interface
+
+uses
+  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+  Dialogs, StdCtrls, Buttons, Mask, JvExMask, JvToolEdit, JvDotNetControls,
+  Registry, VirtualTrees;
+
+type
+  PMacroData = ^TMacroData;
+  TMacroData = record
+    Name: String;
+    FileName: String;
+    Caption: String;
+    Shortcut: String;
+    DebugMode: Boolean;
+    IsNew: Boolean;
+  end;
+
+  TfrmMacroManager = class(TForm)
+    GroupBox1: TGroupBox;
+    Button2: TButton;
+    Label1: TLabel;
+    Label2: TLabel;
+    Label3: TLabel;
+    cboShortcut: TComboBox;
+    sbtnAdd: TSpeedButton;
+    sbtnDelete: TSpeedButton;
+    sbtnSave: TSpeedButton;
+    chkDebug: TCheckBox;
+    txtCaption: TEdit;
+    txtFileName: TEdit;
+    btnBrowseFile: TButton;
+    odlgSelectFile: TOpenDialog;
+    vstMacros: TVirtualStringTree;
+    Label4: TLabel;
+    txtName: TEdit;
+    procedure btnBrowseFileClick(Sender: TObject);
+    procedure vstMacrosGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType; var CellText: WideString);
+    procedure vstMacrosGetNodeDataSize(Sender: TBaseVirtualTree; var NodeDataSize: Integer);
+    procedure FormShow(Sender: TObject);
+    procedure sbtnDeleteClick(Sender: TObject);
+    procedure sbtnSaveClick(Sender: TObject);
+    procedure sbtnAddClick(Sender: TObject);
+    procedure vstMacrosFocusChanging(Sender: TBaseVirtualTree; OldNode, NewNode: PVirtualNode; OldColumn, NewColumn: TColumnIndex; var Allowed: Boolean);
+    procedure vstMacrosFocusChanged(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex);
+    procedure txtNameChange(Sender: TObject);
+    procedure txtFileNameChange(Sender: TObject);
+    procedure txtCaptionChange(Sender: TObject);
+    procedure cboShortcutClick(Sender: TObject);
+    procedure chkDebugClick(Sender: TObject);
+  private
+    { Private declarations }
+    NeedSave: Boolean;
+  public
+    { Public declarations }
+    procedure FillMacroList();
+    function SaveMacro(OldName: String): Boolean;
+  end;
+
+var
+  frmMacroManager: TfrmMacroManager;
+
+implementation
+
+uses Main;
+
+{$R *.dfm}
+
+procedure TfrmMacroManager.FormShow(Sender: TObject);
+var
+  pNode: PVirtualNode;
+begin
+  // Initialize dialog
+  FillMacroList();
+  txtCaption.Text := '';
+  txtName.Text := '';
+  txtFileName.Text := '';
+  cboShortcut.ItemIndex := 0;
+  chkDebug.Checked := False;
+
+  // Attempt to select first node in the tree (if any)
+  pNode := vstMacros.GetFirstChild(vstMacros.RootNode);
+  if Assigned(pNode) then
+  begin
+    vstMacros.Selected[pNode] := True;
+    vstMacrosFocusChanged(vstMacros, pNode, 0);
+  end;
+end;
+
+procedure TfrmMacroManager.btnBrowseFileClick(Sender: TObject);
+begin
+  odlgSelectFile.InitialDir := GetLuaEditInstallPath();
+
+  if odlgSelectFile.Execute then
+    txtFileName.Text := odlgSelectFile.FileName;
+end;
+
+procedure TfrmMacroManager.FillMacroList();
+var
+  x: Integer;
+  pReg: TRegistry;
+  lstKeyList: TStringList;
+  pNode: PVirtualNode;
+  pNodeData: PMacroData;
+begin
+  vstMacros.Clear;
+  vstMacros.BeginUpdate;
+  pReg := TRegistry.Create();
+
+  // Open registry key to read all macros' datas
+  if pReg.OpenKey('\Software\LuaEdit\Macros', False) then
+  begin
+    lstKeyList := TStringList.Create();
+    pReg.GetKeyNames(lstKeyList);
+
+    for x := 0 to lstKeyList.Count - 1 do
+    begin
+      // Open current macro registry key to read macro's values
+      if pReg.OpenKey('\Software\LuaEdit\Macros\' + lstKeyList.Strings[x], False) then
+      begin
+        // Add node in virtual tree
+        pNode := vstMacros.AddChild(vstMacros.RootNode);
+        pNodeData := vstMacros.GetNodeData(pNode);
+        
+        // Fill data record with registry values
+        pNodeData.Name := lstKeyList.Strings[x];
+        pNodeData.FileName := pReg.ReadString('FileName');
+        pNodeData.Caption := pReg.ReadString('Caption');
+        pNodeData.Shortcut := pReg.ReadString('Shortcut');
+        pNodeData.DebugMode := pReg.ReadBool('DebugMode');
+        pNodeData.IsNew := False;
+      end;
+    end;
+
+    lstKeyList.Free;
+  end;
+
+  vstMacros.EndUpdate;
+  pReg.Free;
+
+  // Attempt to select first node in the tree (if any)
+  pNode := vstMacros.GetFirstChild(vstMacros.RootNode);
+  if Assigned(pNode) then
+  begin
+    vstMacros.Selected[pNode] := True;
+    vstMacrosFocusChanged(vstMacros, pNode, 0);
+  end;
+end;
+
+function TfrmMacroManager.SaveMacro(OldName: String): Boolean;
+var
+  pReg: TRegistry;
+begin
+  Result := False;
+  pReg := TRegistry.Create();
+
+  if txtName.Text = '' then
+  begin
+    Application.MessageBox('The marco''s name cannot be empty!', 'LuaEdit', MB_OK+MB_ICONERROR);
+    txtName.SetFocus;
+  end
+  else if pReg.KeyExists('\Software\LuaEdit\Macros\'+txtName.Text) and (OldName <> txtName.Text) and (OldName <> '') then
+  begin
+    Application.MessageBox(PChar('A macro with name "'+txtName.Text+'" already exists!'), 'LuaEdit', MB_OK+MB_ICONERROR);
+    txtName.SetFocus;
+  end
+  else if not FileExists(txtFileName.Text) then
+  begin
+    Application.MessageBox(PChar('The file "'+txtFileName.Text+'" does not exists!'), 'LuaEdit', MB_OK+MB_ICONERROR);
+    txtFileName.SetFocus;
+  end
+  else if txtCaption.Text = '' then
+  begin
+    Application.MessageBox('The macro''s caption cannot be empty!', 'LuaEdit', MB_OK+MB_ICONERROR);
+    txtCaption.SetFocus;
+  end
+  else
+  begin
+    // Open/create the registry key to write datas
+    if pReg.OpenKey('\Software\LuaEdit\Macros\'+txtName.Text, True) then
+    begin
+      // Write macro's datas
+      pReg.WriteString('FileName', txtFileName.Text);
+      pReg.WriteString('Caption', txtCaption.Text);
+      pReg.WriteString('Shortcut', cboShortcut.Text);
+      pReg.WriteBool('DebugMode', chkDebug.Checked);
+    end;
+
+    // Delete previous registry key (the one with the old name... the name might have changed)
+    if (OldName <> '') and (txtName.Text <> OldName) then
+    begin
+      if pReg.KeyExists('\Software\LuaEdit\Macros\'+OldName) then
+      pReg.DeleteKey('\Software\LuaEdit\Macros\'+OldName);
+    end;
+
+    Result := True;
+    NeedSave := False;
+  end;
+
+  pReg.Free;
+end;
+
+procedure TfrmMacroManager.vstMacrosGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType; var CellText: WideString);
+var
+  pData: PMacroData;
+begin
+  // Set text to display for all nodes
+  if TextType = ttNormal then
+  begin
+    case Column of
+      0:
+      begin
+        pData := Sender.GetNodeData(Node);
+        CellText := pData.Name;
+      end;
+      1:
+      begin
+        pData := Sender.GetNodeData(Node);
+        CellText := pData.FileName;
+      end;
+      2:
+      begin
+        pData := Sender.GetNodeData(Node);
+        CellText := pData.Caption;
+      end;
+      3:
+      begin
+        pData := Sender.GetNodeData(Node);
+        CellText := pData.Shortcut;
+      end;
+      4:
+      begin
+        pData := Sender.GetNodeData(Node);
+
+        if pData.DebugMode then
+          CellText := 'Debug'
+        else
+          CellText := 'Release';
+      end;
+    end;
+  end;
+end;
+
+procedure TfrmMacroManager.vstMacrosGetNodeDataSize(Sender: TBaseVirtualTree; var NodeDataSize: Integer);
+begin
+  NodeDataSize := SizeOf(TMacroData);
+end;
+
+procedure TfrmMacroManager.vstMacrosFocusChanging(Sender: TBaseVirtualTree; OldNode, NewNode: PVirtualNode; OldColumn, NewColumn: TColumnIndex; var Allowed: Boolean);
+var
+  pNodeData: PMacroData;
+  IsNew: Boolean;
+begin
+  IsNew := False;
+
+  if OldNode <> NewNode then
+  begin
+    if Assigned(OldNode) then
+    begin
+      pNodeData := vstMacros.GetNodeData(OldNode);
+      IsNew := pNodeData.IsNew;
+    end;
+
+    // Make sure saving is necessary
+    if NeedSave or IsNew then
+    begin
+      // Prompt user to save changes
+      if Application.MessageBox(PChar('Save changes to the "'+txtName.Text+'" macro?'), 'LuaEdit', MB_YESNO+MB_ICONQUESTION) = IDYES then
+      begin
+        // Save macro
+        if Assigned(OldNode) and not IsNew then
+          Allowed := SaveMacro(pNodeData.Name)
+        else
+          Allowed := SaveMacro('');
+
+        // Rebuild the list of macros...
+        FillMacroList();
+      end;
+    end;
+  end
+  else if OldNode = NewNode then
+    Allowed := False;
+end;
+
+procedure TfrmMacroManager.vstMacrosFocusChanged(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex);
+var
+  pNode: PVirtualNode;
+  pNodeData: PMacroData;
+begin
+  pNode := vstMacros.GetFirstSelected();
+
+  if Assigned(pNode) then
+  begin
+    pNodeData := vstMacros.GetNodeData(pNode);
+
+    txtName.Text := pNodeData.Name;
+    txtFileName.Text := pNodeData.FileName;
+    txtCaption.Text := pNodeData.Caption;
+    cboShortcut.ItemIndex := cboShortcut.Items.IndexOf(pNodeData.Shortcut);
+    chkDebug.Checked := pNodeData.DebugMode;
+    NeedSave := False;
+  end;
+end;
+
+procedure TfrmMacroManager.sbtnDeleteClick(Sender: TObject);
+var
+  pNode: PVirtualNode;
+  pNodeData: PMacroData;
+  pReg: TRegistry;
+begin
+  pNode := vstMacros.GetFirstSelected();
+
+  if Assigned(pNode) then
+  begin
+    pNodeData := vstMacros.GetNodeData(pNode);
+
+    // Make sure the user really wants to do this
+    if Application.MessageBox(PChar('Are you sure you want to delete the "'+pNodeData.Name+'" macro?'), 'LuaEdit', MB_YESNO+MB_ICONQUESTION) = IDYES then
+    begin
+      pReg := TRegistry.Create();
+
+      // Delete the related registry key (so in other words, delete the macro)
+      if pReg.OpenKey('\Software\LuaEdit\Macros\'+pNodeData.Name, False) then
+        pReg.DeleteKey('\Software\LuaEdit\Macros\'+pNodeData.Name);
+
+      // Rebuild the list of macros... 
+      FillMacroList();
+    end;
+  end;
+end;
+
+procedure TfrmMacroManager.sbtnSaveClick(Sender: TObject);
+var
+  pNode: PVirtualNode;
+  pNodeData: PMacroData;
+  pReg: TRegistry;
+begin
+  pNode := vstMacros.GetFirstSelected();
+
+  if Assigned(pNode) then
+  begin
+    pNodeData := vstMacros.GetNodeData(pNode);
+
+    // Make sure the user really wants to do this
+    if Application.MessageBox(PChar('Save changes to the "'+txtName.Text+'" macro?'), 'LuaEdit', MB_YESNO+MB_ICONQUESTION) = IDYES then
+    begin
+      SaveMacro(pNodeData.Name);
+
+      // Rebuild the list of macros...
+      FillMacroList();
+    end;
+  end;
+end;
+
+procedure TfrmMacroManager.sbtnAddClick(Sender: TObject);
+var
+  pNode: PVirtualNode;
+  pNodeData: PMacroData;
+begin
+  // Create node and retrieve data pointer
+  pNode := vstMacros.AddChild(vstMacros.RootNode);
+  pNodeData := vstMacros.GetNodeData(pNode);
+
+  pNodeData.Name := 'New Macro';
+  pNodeData.FileName := '';
+  pNodeData.Caption := 'New Macro';
+  pNodeData.Shortcut := '[None]';
+  pNodeData.DebugMode := False;
+  pNodeData.IsNew := True;
+
+  // Select newly created node
+  vstMacros.Selected[pNode] := True;
+  vstMacrosFocusChanged(vstMacros, pNode, 0);
+  NeedSave := True;
+end;
+
+procedure TfrmMacroManager.txtNameChange(Sender: TObject);
+begin
+  NeedSave := True;
+end;
+
+procedure TfrmMacroManager.txtFileNameChange(Sender: TObject);
+begin
+  NeedSave := True;
+end;
+
+procedure TfrmMacroManager.txtCaptionChange(Sender: TObject);
+begin
+  NeedSave := True;
+end;
+
+procedure TfrmMacroManager.cboShortcutClick(Sender: TObject);
+begin
+  NeedSave := True;
+end;
+
+procedure TfrmMacroManager.chkDebugClick(Sender: TObject);
+begin
+  NeedSave := True;
+end;
+
+end.