Skip to content

Commit 266ce0d

Browse files
authored
Add files via upload
1 parent 660f377 commit 266ce0d

21 files changed

+348
-35
lines changed

AHK Visual 2.0.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
<WarningLevel>4</WarningLevel>
3434
</PropertyGroup>
3535
<ItemGroup>
36+
<Reference Include="Microsoft.VisualBasic" />
37+
<Reference Include="PresentationCore" />
3638
<Reference Include="System" />
3739
<Reference Include="System.Core" />
3840
<Reference Include="System.Xml.Linq" />
@@ -44,6 +46,7 @@
4446
<Reference Include="System.Net.Http" />
4547
<Reference Include="System.Windows.Forms" />
4648
<Reference Include="System.Xml" />
49+
<Reference Include="WindowsBase" />
4750
</ItemGroup>
4851
<ItemGroup>
4952
<Compile Include="Helper.cs" />

AHK Visual 2.0.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ Global
1111
Release|Any CPU = Release|Any CPU
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{A16DE808-F6EA-431A-8CB8-6DDC050CF77A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{A16DE808-F6EA-431A-8CB8-6DDC050CF77A}.Debug|Any CPU.Build.0 = Debug|Any CPU
14+
{A16DE808-F6EA-431A-8CB8-6DDC050CF77A}.Debug|Any CPU.ActiveCfg = Release|Any CPU
15+
{A16DE808-F6EA-431A-8CB8-6DDC050CF77A}.Debug|Any CPU.Build.0 = Release|Any CPU
1616
{A16DE808-F6EA-431A-8CB8-6DDC050CF77A}.Release|Any CPU.ActiveCfg = Release|Any CPU
1717
{A16DE808-F6EA-431A-8CB8-6DDC050CF77A}.Release|Any CPU.Build.0 = Release|Any CPU
1818
EndGlobalSection

Main.Designer.cs

Lines changed: 182 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Main.cs

Lines changed: 128 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
using System.Windows.Input;
2+
using System;
23
using System.Collections.Generic;
34
using System.Drawing;
45
using System.IO;
@@ -12,6 +13,7 @@ public partial class MainForm : Form
1213
{
1314
String lastModKey;
1415
String[] currXY = new String[4];
16+
String selectedSpecialKey;
1517
int topTab = 71;
1618
int selectedTab = 0;
1719
int activeLoops = 0;
@@ -22,13 +24,49 @@ public partial class MainForm : Form
2224
bool insertAtCursor = false;
2325
bool newLine = false;
2426
bool useSend = false;
25-
27+
bool checkForSend = true;
28+
bool checkForNewLine = true;
29+
bool checkForInsert = false;
2630

2731
public MainForm()
2832
{
2933
InitializeComponent();
3034
}
3135

36+
//Right Click Menu Start
37+
38+
private void moveInsertionPorintToolStripMenuItem_Click(object sender, EventArgs e)
39+
{
40+
checkForInsert = !checkForInsert;
41+
CheckForMoveInsertionPoint.Checked = !CheckForMoveInsertionPoint.Checked;
42+
}
43+
44+
private void useSendToolStripMenuItem_Click(object sender, EventArgs e)
45+
{
46+
checkForSend = !checkForSend;
47+
CheckForSend.Checked = !CheckForSend.Checked;
48+
}
49+
50+
private void useNewLineToolStripMenuItem_Click(object sender, EventArgs e)
51+
{
52+
checkForNewLine = !checkForNewLine;
53+
CheckForNewLine.Checked = !CheckForNewLine.Checked;
54+
}
55+
56+
private void insertAtCursorToolStripMenuItem_Click(object sender, EventArgs e)
57+
{
58+
checkForInsert = !checkForInsert;
59+
CheckToInsertAtCursor.Checked = !CheckToInsertAtCursor.Checked;
60+
}
61+
62+
private void saveFileToolStripMenuItem_Click(object sender, EventArgs e)
63+
{
64+
ExportButton_Click(null, null);
65+
}
66+
67+
//Right Click Menu Stop
68+
69+
3270
private void CreateFile(string path, string dataToWrite)
3371
{
3472
try
@@ -92,7 +130,7 @@ private void modifierKeyInput_TextChanged(object sender, EventArgs e)
92130
lastModKey = modifierKeyInput.Text;
93131
}
94132

95-
private void modifierKeyInput_KeyDown(Object sender, KeyEventArgs e)
133+
private void modifierKeyInput_KeyDown(Object sender, System.Windows.Forms.KeyEventArgs e)
96134
{
97135
if (e.KeyCode == Keys.Back)
98136
{
@@ -233,32 +271,51 @@ private void ButtonForSaveVariableHelp_Click(object sender, EventArgs e)
233271

234272
private void hotKeyAssignButton_Click(object sender, EventArgs e)
235273
{
274+
String text;
236275
hotKeySet = true;
237276
if (!CheckForTopOfCode.Checked)
238277
{
239-
MainCode.AppendText(savedModifierInput.Text + "::\r\n");
278+
text = savedModifierInput.Text + "::\r\n";
279+
280+
CheckForSend.Checked = false;
281+
282+
Helper.WriteToBox(CheckToInsertAtCursor, CheckForNewLine, CheckForSend, text, MainCode, selectedTab);
283+
Helper.Indent(MainCode, activeLoops, indent);
284+
285+
CheckForSend.Checked = checkForSend;
240286
return;
241287
}
288+
else
289+
{
290+
MainCode.Text = MainCode.Text.Insert(70, "\r\n" + savedModifierInput.Text + "::\r\n");
291+
topTab += savedModifierInput.TextLength + 3;
292+
}
242293

243-
MainCode.Text = MainCode.Text.Insert(70, "\r\n" + savedModifierInput.Text + "::\r\n");
244-
topTab += savedModifierInput.TextLength + 3;
245294
}
246295

247-
private void FileNameInput_KeyDown(object sender, KeyEventArgs e)
296+
private void FileNameInput_TextChanged(object sender, EventArgs e)
248297
{
249-
if (e.KeyCode == Keys.Enter)
298+
if (FileNameInput.TextLength <= 0)
299+
{
300+
ExportButton.Enabled = false;
301+
ChangeNameButton.Enabled = false;
302+
ToolStripButtonExport.Enabled = false;
303+
TextBoxForFileNameGlobal.Text = "";
304+
ButtonForFileExportGlobal.Enabled = false;
305+
}
306+
else
250307
{
251308
ExportButton.Enabled = true;
252-
FileNameInput.Enabled = false;
253309
ChangeNameButton.Enabled = true;
254310
ToolStripButtonExport.Enabled = true;
311+
TextBoxForFileNameGlobal.Text = FileNameInput.Text + ".ahk";
312+
ButtonForFileExportGlobal.Enabled = true;
255313
}
256314
}
257315

258316
private void FileNameInput_KeyDown()
259317
{
260318
ExportButton.Enabled = true;
261-
FileNameInput.Enabled = false;
262319
ChangeNameButton.Enabled = true;
263320
ToolStripButtonExport.Enabled = true;
264321
}
@@ -299,7 +356,16 @@ private void ModkeyButton_Click(object sender, EventArgs e)
299356

300357
private void SpecialKeyInput_SelectedIndexChanged(object sender, EventArgs e)
301358
{
302-
TextInput.AppendText(SpecialKeyInput.Text);
359+
if (CheckForDontAdd.Checked)
360+
{
361+
TextInput.AppendText(SpecialKeyInput.Text);
362+
selectedSpecialKey = SpecialKeyInput.Text;
363+
ButtonForSpecialKeyUp.Enabled = true;
364+
}
365+
else
366+
{
367+
ButtonForSpecialKeyUp.Enabled = true;
368+
}
303369
}
304370

305371
private void AddToMainCode_Click(object sender, EventArgs e)
@@ -413,18 +479,25 @@ private void ButtonToSendMsgBoxToCode_Click(object sender, EventArgs e)
413479
private void CheckToInsertAtCursor_CheckedChanged(object sender, EventArgs e)
414480
{
415481
insertAtCursor = !insertAtCursor;
482+
checkForInsert = !checkForInsert;
416483
}
417484

418485
private void CheckForNewLine_CheckedChanged(object sender, EventArgs e)
419486
{
420487
newLine = !newLine;
488+
checkForNewLine = !checkForNewLine;
421489
}
422490

423491
private void CheckForSend_CheckedChanged(object sender, EventArgs e)
424492
{
425493
useSend = !useSend;
426494
}
427495

496+
private void CheckForSend_Click(object sender, EventArgs e)
497+
{
498+
checkForSend = !checkForSend;
499+
}
500+
428501
private void ButtonForVarEqualTo_Click(object sender, EventArgs e)
429502
{
430503
String text = ComboForEqualVarOne.Text + " := " + ComboForEqualVarTwo.Text;
@@ -460,6 +533,27 @@ private void CheckForLargeTextBox_CheckedChanged(object sender, EventArgs e)
460533
}
461534
}
462535

536+
private void ButtonForSpecialKeyDown_Click(object sender, EventArgs e)
537+
{
538+
if(SpecialKeyInput.Text.Length == 0)
539+
{
540+
return;
541+
}
542+
543+
String text = "{" + SpecialKeyInput.Text.Substring(1, SpecialKeyInput.Text.Length - 3) + " Down}";
544+
545+
Helper.WriteToBox(CheckToInsertAtCursor, CheckForNewLine, CheckForSend, text, MainCode, selectedTab);
546+
Helper.Indent(MainCode, activeLoops, indent);
547+
}
548+
549+
private void ButtonForSpecialKeyUp_Click(object sender, EventArgs e)
550+
{
551+
String text = "{" + SpecialKeyInput.Text.Substring(1, SpecialKeyInput.Text.Length - 3) + " Up}";
552+
553+
Helper.WriteToBox(CheckToInsertAtCursor, CheckForNewLine, CheckForSend, text, MainCode, selectedTab);
554+
Helper.Indent(MainCode, activeLoops, indent);
555+
}
556+
463557
//Text Tab End
464558

465559

@@ -710,6 +804,7 @@ private void ImportFile_Click(object sender, EventArgs e)
710804

711805
hotKeySet = true;
712806
FileNameInput.Text = Path.GetFileNameWithoutExtension(fileName);
807+
TextBoxForFileNameGlobal.Text = Path.GetFileName(fileName);
713808
FileNameInput_KeyDown();
714809
}
715810

@@ -718,6 +813,28 @@ private void MainCode_Leave(object sender, EventArgs e)
718813
selectedTab = MainCode.SelectionStart;
719814
}
720815

816+
private void ButtonForFileExportGlobal_Click(object sender, EventArgs e)
817+
{
818+
ExportButton_Click(null, null);
819+
}
820+
821+
822+
private void MainForm_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
823+
{
824+
if (e.KeyCode == Keys.S && e.Modifiers == Keys.Control)
825+
{
826+
827+
if(FileNameInput.TextLength == 0)
828+
{
829+
MessageBox.Show("Enter a name for the file before saving", "File Name Needed");
830+
}
831+
else
832+
{
833+
ExportButton_Click(null, null);
834+
}
835+
}
836+
}
837+
721838
//Tool Strip End
722839

723840
}

Main.resx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,11 @@
117117
<resheader name="writer">
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120+
<metadata name="RightClickMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121+
<value>117, 13</value>
122+
</metadata>
120123
<metadata name="toolStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121-
<value>122, 17</value>
124+
<value>18, 8</value>
122125
</metadata>
123126
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
124127
<data name="ImportFile.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
@@ -136,4 +139,7 @@
136139
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
137140
</value>
138141
</data>
142+
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
143+
<value>True</value>
144+
</metadata>
139145
</root>

bin/Debug/AHK Visual 2.0.exe

5 KB
Binary file not shown.

bin/Debug/AHK Visual 2.0.pdb

6 KB
Binary file not shown.

bin/Debug/Balls.ahk

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#NoEnv
2+
#Warn
3+
SetWorkingDir %A_ScriptDir%
4+
CoordMode, Mouse, Screen
5+
6+
^d::
7+
8+
9+
Send, ^s
10+
Send, ^a
11+
Send, ^c
12+
Send, {Alt}
13+
Send, {Tab}
14+
Send, ^a
15+
Send, ^v
16+
Send, {F3}
17+
Send, {F5}

bin/Debug/asdasdasd.ahk

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#NoEnv
2+
#Warn
3+
SetWorkingDir %A_ScriptDir%
4+
CoordMode, Mouse, Screen
5+
6+
7+
^d::
8+

bin/Release/AHK Visual 2.0.exe

5.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)