Skip to content

Commit

Permalink
* Added option to show group names as comments in *View menu* > *Prev…
Browse files Browse the repository at this point in the history
…iew Script* and Preview panel toolbar.

* Fixed *Expand all groups* not working.
* Fixed global context condition being set to macro context.
  • Loading branch information
Pulover committed Oct 8, 2020
1 parent 72ab84b commit 389b9c7
Show file tree
Hide file tree
Showing 63 changed files with 175 additions and 22 deletions.
5 changes: 4 additions & 1 deletion Documentation/About.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ chosen1ft for fixing the mixing rows bug when saving a project.
# Change Log

## Version 5.2.8
* Added option to show Group names as comments in *View menu* > *Preview Script* and Preview toolbar.
* Fixed `A_` variables not working as `InputVar` parameter for commands.
* Fixed some hotkeys not updating Play hotkey.
* Fixed *Expand all groups* not working.
* Fixed some hotkeys not updating the Play hotkey.
* Fixed problem with subtraction in expressions.
* Fixed global context condition being set to macro context.

## Version 5.2.7
* Added support for `&`, `*`, `~` and `Up` as modifier symbols for Play hotkey.
Expand Down
4 changes: 4 additions & 0 deletions Documentation/Preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ Converts line break symbols (\`n) in command parameters to real line breaks.

Keeps unchecked rows in the macro as commented out script, instead of not exporting them.

### Show groups as comments

Adds group names as single-line comments in the preview/exported script.

### Line Wrap

Automatically add a line break to long lines.
Expand Down
10 changes: 7 additions & 3 deletions LIB/Class_LV_Rows.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -966,10 +966,11 @@ Class LV_Rows extends LV_Rows.LV_EX
; automatically in from other functions, usually it's not
; necessary to use it in your script.
; Parameters:
; Collapsed: If true collapses all groups in the selected ListView.
; Collapsed: If true collapses all groups in the selected ListView. If false
; expands all groups in selected ListView.
; Return: No return value.
;=======================================================================================
RefreshGroups(Collapsed := false)
RefreshGroups(Collapsed := "")
{
GroupStates := []
Gui, Listview, % this.LVHwnd
Expand All @@ -985,7 +986,10 @@ Class LV_Rows extends LV_Rows.LV_EX
If (this.Handle.GroupsArray[GrNum].Row = A_Index)
{
this.GroupInsert(GrNum + 9, this.Handle.GroupsArray[GrNum].Name)
, Styles := Collapsed ? ["Collapsible", "Collapsed"] : this.Collapsible ? ["Collapsible", GroupStates[GrNum]] : []
, Styles := !this.Collapsible ? []
: Collapsed = "" ? ["Collapsible", GroupStates[GrNum]]
: Collapsed ? ["Collapsible", "Collapsed"]
: ["Collapsible", ""]
, this.GroupSetState(GrNum + 9, Styles*)
, GrNum++
}
Expand Down
4 changes: 2 additions & 2 deletions LIB/Definitions.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -1122,10 +1122,10 @@ DefaultBar := {FileOpt: "Enabled AutoSize", File: ["New=" w_Lang112 ":41", "Open
, "", "Import=" w_Lang076 ":28", "SaveCurrentList=" w_Lang077 ":67"
, "", "UserFunction=" w_Lang104 ":35", "FuncParameter=" w_Lang105 ":107", "FuncReturn=" w_Lang106 ":105"]}
FixedBar := {PrevOpt: "Enabled AutoSize", Preview: ["PrevCopy=" c_Lang023 ":8", "PrevRefreshButton=" t_Lang014 ":90(Enabled Dropdown)", "GoToLine=" t_Lang218 ":22(Enabled Dropdown)"
, "", "TabIndent=" t_Lang011 ":85(Enabled Dropdown)", "ConvertBreaks=" t_Lang190 ":76", "CommentUnchecked=" w_Lang108 ":5", "TextWrap=" t_Lang052 ":96", "PrevFontShow=" v_Lang011 ":70(Enabled Dropdown)"
, "", "TabIndent=" t_Lang011 ":85(Enabled Dropdown)", "ConvertBreaks=" t_Lang190 ":76", "CommentUnchecked=" w_Lang108 ":5(Enabled Dropdown)", "TextWrap=" t_Lang052 ":96", "PrevFontShow=" v_Lang011 ":70(Enabled Dropdown)"
, "", "EditScript=" t_Lang138 ":109", "PrevDock=" t_Lang124 ":106", "Preview=" c_Lang022 ":108"]
, PreviewF: ["PrevCopy=" c_Lang023 ":8", "PrevRefreshButton=" t_Lang014 ":90(Enabled Dropdown)", "GoToLine=" t_Lang218 ":22(Enabled Dropdown)"
, "", "TabIndent=" t_Lang011 ":85(Enabled Dropdown)", "ConvertBreaks=" t_Lang190 ":76", "CommentUnchecked=" w_Lang108 ":5", "TextWrap=" t_Lang052 ":96", "PrevFontShow=" v_Lang011 ":70(Enabled Dropdown)", "OnTop=" t_Lang016 ":81"
, "", "TabIndent=" t_Lang011 ":85(Enabled Dropdown)", "ConvertBreaks=" t_Lang190 ":76", "CommentUnchecked=" w_Lang108 ":5(Enabled Dropdown)", "TextWrap=" t_Lang052 ":96", "PrevFontShow=" v_Lang011 ":70(Enabled Dropdown)", "OnTop=" t_Lang016 ":81"
, "", "EditScript=" t_Lang138 ":109", "PrevDock=" t_Lang125 ":93"]
, TextOpt: "Enabled AutoSize", Text: ["OpenT=" t_Lang126 ":42", "SaveT=" t_Lang127 ":59"
, "", "CutT=" t_Lang128 ":9", "CopyT=" t_Lang129 ":8", "PasteT=" t_Lang130 ":44"
Expand Down
12 changes: 7 additions & 5 deletions LIB/Export.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@
, PAction, PType, PDelayX, PComment, Act, iCount, init_ie, ComExp
, VarsScope, FuncParams, IsFunction := false, CommentOut := false
, CDO_To, CDO_Sub, CDO_Msg, CDO_Att, CDO_Html, CDO_CC, CDO_BCC, SelAcc
, _each, _Section, _CodeLine
, _each, _Section, _CodeLine, _Groups, _NextGroup := 1
Gui, chMacro:Default
Gui, chMacro:ListView, InputList%ListID%
ComType := ComCr ? "ComObjCreate" : "ComObjActive"
_Groups := LVManager[ListID].GetGroups(true)
Critical
Loop, % LV_GetCount()
{
LV_GetTexts(A_Index, Action, Step, TimesX, DelayX, Type, Target, Window, Comment)
, IsChecked := LV_GetNext(A_Index-1, "Checked")
If ((ShowGroupNames) && (_Groups[_NextGroup].Row = A_Index))
LVData .= "`n`; " _Groups[_NextGroup].Name, _NextGroup++
If (CodeLines) {
StrReplace(LVData, "`n", "", _CodeLine)
, CodeLines.Push(_CodeLine + 1)
Expand Down Expand Up @@ -541,11 +544,10 @@
}
}
If ((IsChecked = A_Index) && (CommentOut))
LVData .= "`n*/" RowData, CommentOut := false
RowData := "`n*/" RowData, CommentOut := false
Else If ((IsChecked != A_Index) && (!CommentOut) && (Type != cType42))
LVData .= "`n/*" RowData, CommentOut := true
Else
LVData .= RowData
RowData := "`n/*" RowData, CommentOut := true
LVData .= RowData
}
If (CommentOut)
LVData .= "`n*/"
Expand Down
6 changes: 6 additions & 0 deletions LIB/Internal.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,12 @@ ShowMenu(Menu, mX, mY)
Menu, TbMenu, Check, %t_Lang211%
Menu, TbMenu, Show, %mX%, %mY%
Menu, TbMenu, DeleteAll
Case "CommentUnchecked":
Menu, TbMenu, Add, %w_Lang114%, ShowGroupNames
If (ShowGroupNames)
Menu, TbMenu, Check, %w_Lang114%
Menu, TbMenu, Show, %mX%, %mY%
Menu, TbMenu, DeleteAll
Case "PrevFontShow":
Menu, PrevFontMenu, Add, 6, PrevFontSet, Radio
Menu, PrevFontMenu, Add, 7, PrevFontSet, Radio
Expand Down
2 changes: 2 additions & 0 deletions Lang/ar.lang
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
v_Lang036 = تحويل فواصل الأسطر(&O)
v_Lang037 = التعليق خارج الصفوف دون رادع(&M)
v_Lang038 = التفاف الخط(&L)
v_Lang039 = إظهار المجموعات كتعليقات(&H)

; 09. Options Sub Menu
o_Lang001 = إعدادات(&S)
Expand Down Expand Up @@ -311,6 +312,7 @@
w_Lang111 = البحث عن... (اضغط على Enter للانتقال)
w_Lang112 = جديدة (السيطرة+N)
w_Lang113 = اذهب إلى...
w_Lang114 = إظهار المجموعات كتعليقات

; 15. Command Windows
c_Lang001 = فأر
Expand Down
2 changes: 2 additions & 0 deletions Lang/bg.lang
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
v_Lang036 = К&онвертиране на нови редове
v_Lang037 = Ко&ментирайте непроверени редове
v_Lang038 = &Line обвивка
v_Lang039 = По&казване на групи като коментари

; 09. Options Sub Menu
o_Lang001 = &Настройки
Expand Down Expand Up @@ -311,6 +312,7 @@
w_Lang111 = Търсене... (Натиснете Enter, за да отидете)
w_Lang112 = New (Ctrl+N)
w_Lang113 = Otidete
w_Lang114 = Показване на групи като коментари

; 15. Command Windows
c_Lang001 = Мишка
Expand Down
2 changes: 2 additions & 0 deletions Lang/ca.lang
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
v_Lang036 = C&onverteix salts de línia
v_Lang037 = Co&menteu files sense marcar
v_Lang038 = En&rotlleu
v_Lang039 = Mostra e&ls grups com a comentaris

; 09. Options Sub Menu
o_Lang001 = &Configuració
Expand Down Expand Up @@ -311,6 +312,7 @@
w_Lang111 = Cercar... (Premeu Retorn per anar)
w_Lang112 = Nou (Ctrl+N)
w_Lang113 = Anar a...
w_Lang114 = Mostra els grups com a comentaris

; 15. Command Windows
c_Lang001 = Ratolí
Expand Down
2 changes: 2 additions & 0 deletions Lang/cs.lang
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
v_Lang036 = P&řevod řádků
v_Lang037 = Ko&mentář mimo nezkontrolované řádků
v_Lang038 = &Zalamovat
v_Lang039 = Zo&brazit skupiny jako komentáře

; 09. Options Sub Menu
o_Lang001 = &Nastavení
Expand Down Expand Up @@ -311,6 +312,7 @@
w_Lang111 = Vyhledávání... (Klávesou Enter prejdete)
w_Lang112 = New (Ctrl+N)
w_Lang113 = Jít do...
w_Lang114 = Zobrazit skupiny jako komentáře

; 15. Command Windows
c_Lang001 = Myš
Expand Down
2 changes: 2 additions & 0 deletions Lang/cy.lang
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
v_Lang036 = Tr&osi toriadau llinell
v_Lang037 = &Sylw allan rhesi ddirwystr
v_Lang038 = Amla&pio llinell
v_Lang039 = Da&ngos grwpiau fel sylwadau

; 09. Options Sub Menu
o_Lang001 = &Gosodiadau
Expand Down Expand Up @@ -311,6 +312,7 @@
w_Lang111 = Chwilio ... (Gwasg Enter i fynd)
w_Lang112 = Newydd (Ctrl + D)
w_Lang113 = Mynd i...
w_Lang114 = Dangos grwpiau fel sylwadau

; 15. Command Windows
c_Lang001 = Llygoden
Expand Down
2 changes: 2 additions & 0 deletions Lang/da.lang
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
v_Lang036 = Ko&nverter linjeskift
v_Lang037 = &Udkommentere ukontrolleret rækker
v_Lang038 = &Linje wrap
v_Lang039 = Vi&s grupper som kommentarer

; 09. Options Sub Menu
o_Lang001 = &Indstillinger
Expand Down Expand Up @@ -311,6 +312,7 @@
w_Lang111 = Søg... (Tryk Enter for at gå)
w_Lang112 = Ny (Ctrl+N)
w_Lang113 = Gå til...
w_Lang114 = Vis grupper som kommentarer

; 15. Command Windows
c_Lang001 = Mus
Expand Down
2 changes: 2 additions & 0 deletions Lang/de.lang
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
v_Lang036 = &Zeilenumbrüche konvertieren
v_Lang037 = &Nicht markiert Zeilen kommentieren
v_Lang038 = Ze&ilenumbruch
v_Lang039 = &Gruppen als Kommentare anzeigen

; 09. Options Sub Menu
o_Lang001 = &Einstellungen
Expand Down Expand Up @@ -311,6 +312,7 @@
w_Lang111 = Suchen... (Drücken Sie die Eingabetaste zu gehen)
w_Lang112 = Neu (Strg+N)
w_Lang113 = Gehe zu...
w_Lang114 = Gruppen als Kommentare anzeigen

; 15. Command Windows
c_Lang001 = Maus
Expand Down
2 changes: 2 additions & 0 deletions Lang/el.lang
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
v_Lang036 = &Μετατροπή αλλαγών γραμμής
v_Lang037 = &Σχόλιο από ανεξέλεγκτη σειρές
v_Lang038 = &Γραμμή wrap
v_Lang039 = Ε&μφάνιση ομάδων ως σχόλια

; 09. Options Sub Menu
o_Lang001 = &Ρυθμίσεις
Expand Down Expand Up @@ -311,6 +312,7 @@
w_Lang111 = Αναζήτηση... (Πατήστε Enter για να μεταβείτε)
w_Lang112 = Νέο (Ctrl+N)
w_Lang113 = Pao
w_Lang114 = Εμφάνιση ομάδων ως σχόλια

; 15. Command Windows
c_Lang001 = Ποντίκι
Expand Down
2 changes: 2 additions & 0 deletions Lang/en.lang
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
v_Lang036 = C&onvert line breaks
v_Lang037 = Co&mment out unchecked rows
v_Lang038 = &Line wrap
v_Lang039 = S&how groups as comments

; 09. Options Sub Menu
o_Lang001 = &Settings
Expand Down Expand Up @@ -311,6 +312,7 @@
w_Lang111 = Search... (Press Enter to go)
w_Lang112 = New (Ctrl+N)
w_Lang113 = Go to...
w_Lang114 = Show groups as comments

; 15. Command Windows
c_Lang001 = Mouse
Expand Down
4 changes: 3 additions & 1 deletion Lang/es.lang
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
v_Lang036 = C&onvertir saltos de línea
v_Lang037 = Co&mente filas sin marcar
v_Lang038 = A&juste de línea
v_Lang039 = Most&rar grupos como comentarios

; 09. Options Sub Menu
o_Lang001 = &Configuración
Expand Down Expand Up @@ -310,7 +311,8 @@
w_Lang110 = Utilizar un botón del joystick como tecla de acceso directo
w_Lang111 = Buscar... (Pulse Intro para ir)
w_Lang112 = Nuevo (Ctrl+N)
w_Lang113 = Akṣara
w_Lang113 = Ir...
w_Lang114 = Mostrar grupos como comentarios

; 15. Command Windows
c_Lang001 = Ratón
Expand Down
2 changes: 2 additions & 0 deletions Lang/et.lang
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
v_Lang036 = &Convert reavahetused
v_Lang037 = K&ommentaar välja märkimata rida
v_Lang038 = L&ine wrap
v_Lang039 = K&uva rühmad kommentaaridena

; 09. Options Sub Menu
o_Lang001 = &Seaded
Expand Down Expand Up @@ -311,6 +312,7 @@
w_Lang111 = Otsi ... (liikumiseks vajutage sisestusklahvi)
w_Lang112 = New (Ctrl + N)
w_Lang113 = Minema...
w_Lang114 = Kuva rühmad kommentaaridena

; 15. Command Windows
c_Lang001 = Hiir
Expand Down
2 changes: 2 additions & 0 deletions Lang/eu.lang
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
v_Lang036 = &Bihurtu lerro-jauziak
v_Lang037 = K&omentatu Deshautatzen errenkadak
v_Lang038 = &Line wrap
v_Lang039 = E&rakutsi taldeak iruzkin gisa

; 09. Options Sub Menu
o_Lang001 = &Ezarpenak
Expand Down Expand Up @@ -311,6 +312,7 @@
w_Lang111 = Search ... (Sakatu Sartu joan)
w_Lang112 = Berria (Ctrl + N)
w_Lang113 = Joan...
w_Lang114 = Erakutsi taldeak iruzkin gisa

; 15. Command Windows
c_Lang001 = Mouse
Expand Down
2 changes: 2 additions & 0 deletions Lang/fa.lang
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
v_Lang036 = تبدیل پرش به خط(&O)
v_Lang037 = اظهار نظر از ردیف بدون کنترل(&M)
v_Lang038 = بسته بندی خط(&L)
v_Lang039 = نمایش گروه ها به عنوان نظر(&H)

; 09. Options Sub Menu
o_Lang001 = تنظیمات(&S)
Expand Down Expand Up @@ -311,6 +312,7 @@
w_Lang111 = جستجو ... (مطبوعات را وارد کنید به)
w_Lang112 = جدید (Ctrl + N)
w_Lang113 = قابل اعتماد و متخصص...
w_Lang114 = نمایش گروه ها به عنوان نظر

; 15. Command Windows
c_Lang001 = ماوس
Expand Down
2 changes: 2 additions & 0 deletions Lang/fi.lang
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
v_Lang036 = &Muuta rivinvaihdot
v_Lang037 = K&ommentoi pois valitsematta riviä
v_Lang038 = L&ine wrap
v_Lang039 = &Näytä ryhmät kommentteina

; 09. Options Sub Menu
o_Lang001 = &Asetukset
Expand Down Expand Up @@ -311,6 +312,7 @@
w_Lang111 = Etsi... (Paina Enter päästäksesi)
w_Lang112 = Uusi (Ctrl+N)
w_Lang113 = Mene...
w_Lang114 = Näytä ryhmät kommentteina

; 15. Command Windows
c_Lang001 = Hiiri
Expand Down
2 changes: 2 additions & 0 deletions Lang/fr.lang
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
v_Lang036 = Co&nvertir les sauts de ligne
v_Lang037 = Co&mmentaire sur les lignes non contrôlées
v_Lang038 = &Wrap ligne
v_Lang039 = A&fficher les groupes sous forme de commentaires

; 09. Options Sub Menu
o_Lang001 = &Réglages
Expand Down Expand Up @@ -311,6 +312,7 @@
w_Lang111 = Rechercher... (Appuyez sur Entrée pour aller)
w_Lang112 = Nouveau (Ctrl+N)
w_Lang113 = Aller à...
w_Lang114 = Afficher les groupes sous forme de commentaires

; 15. Command Windows
c_Lang001 = Souris
Expand Down
2 changes: 2 additions & 0 deletions Lang/gl.lang
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
v_Lang036 = C&onverter saltos de liña
v_Lang037 = Co&mentar as liñas marcar
v_Lang038 = &Quebra automática de liña
v_Lang039 = Most&rar grupos como comentarios

; 09. Options Sub Menu
o_Lang001 = &Configuración
Expand Down Expand Up @@ -311,6 +312,7 @@
w_Lang111 = Buscar ... (Prema Intro para ir)
w_Lang112 = New (Ctrl + N)
w_Lang113 = Ir a...
w_Lang114 = Mostrar grupos como comentarios

; 15. Command Windows
c_Lang001 = Rato
Expand Down
2 changes: 2 additions & 0 deletions Lang/he.lang
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
v_Lang036 = המר שורות חדשות(&O)
v_Lang037 = תגובה מתוך שורות מסומנות(&M)
v_Lang038 = לעטוף Line(&L)
v_Lang039 = הראה קבוצות כהערות(&H)

; 09. Options Sub Menu
o_Lang001 = הגדרות(&S)
Expand Down Expand Up @@ -311,6 +312,7 @@
w_Lang111 = חיפוש ... (הקש Enter כדי לעבור)
w_Lang112 = חדש (Ctrl + N)
w_Lang113 = לך ל...
w_Lang114 = הראה קבוצות כהערות

; 15. Command Windows
c_Lang001 = עכבר
Expand Down
Loading

0 comments on commit 389b9c7

Please sign in to comment.