Added icons; updated preview code formatting

This commit is contained in:
itdominator 2023-10-22 20:44:20 -05:00
parent 8aa3d96617
commit fa1e17f4e5
21 changed files with 224 additions and 196 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 KiB

After

Width:  |  Height:  |  Size: 200 KiB

View File

@ -9,44 +9,46 @@ samples = {}
samples['ada'] = """ samples['ada'] = """
with Ada.Text_Io; use Ada.Text_Io; with Ada.Text_Io; use Ada.Text_Io;
procedure Doors is procedure Doors is
type Door_State is (Closed, Open); type Door_State is (Closed, Open);
type Door_List is array(Positive range 1..100) of Door_State; type Door_List is array(Positive range 1..100) of Door_State;
The_Doors : Door_List := (others => Closed); The_Doors : Door_List := (others => Closed);
begin
for I in 1..100 loop begin
for J in The_Doors'range loop for I in 1..100 loop
if J mod I = 0 then for J in The_Doors'range loop
if The_Doors(J) = Closed then if J mod I = 0 then
The_Doors(J) := Open; if The_Doors(J) = Closed then
else The_Doors(J) := Open;
The_Doors(J) := Closed; else
end if; The_Doors(J) := Closed;
end if; end if;
end loop; end if;
end loop; end loop;
for I in The_Doors'range loop end loop;
Put_Line(Integer'Image(I) & " is " & Door_State'Image(The_Doors(I)));
end loop; for I in The_Doors'range loop
end Doors; Put_Line(Integer'Image(I) & " is " & Door_State'Image(The_Doors(I)));
end loop;
end Doors;
""" """
samples['asp'] = """ samples['asp'] = """
<html> <html>
<body> <body>
<form action="demo_reqquery.asp" method="get"> <form action="demo_reqquery.asp" method="get">
Your name: <input type="text" name="fname" size="20" /> Your name: <input type="text" name="fname" size="20" />
<input type="submit" value="Submit" /> <input type="submit" value="Submit" />
</form> </form>
<% <%
dim fname dim fname
fname=Request.QueryString("fname") fname=Request.QueryString("fname")
If fname<>"" Then If fname<>"" Then
Response.Write("Hello " & fname & "!<br />") Response.Write("Hello " & fname & "!<br />")
Response.Write("How are you today?") Response.Write("How are you today?")
End If End If
%> %>
</body> </body>
</html> </html>
""" """
@ -55,18 +57,19 @@ End If
samples['awk'] = """ samples['awk'] = """
BEGIN { BEGIN {
for(i=1; i <= 100; i++) { for(i = 1; i <= 100; i++) {
doors[i] = 0 # close the doors doors[i] = 0 # close the doors
} }
for(i=1; i <= 100; i++) {
if ( int(sqrt(i)) == sqrt(i) ) { for(i = 1; i <= 100; i++) {
doors[i] = 1 if ( int(sqrt(i)) == sqrt(i) ) {
doors[i] = 1
}
}
for(i = 1; i <= 100; i++) {
print i, doors[i] ? "open" : "close"
} }
}
for(i=1; i <= 100; i++)
{
print i, doors[i] ? "open" : "close"
}
} }
""" """
@ -78,34 +81,33 @@ BEGIN {
samples['c'] = """ samples['c'] = """
/* Some comments */ /* Some comments */
#include <stdio.h> #include <stdio.h>
int main() int main() {
{ int square = 1, increment = 3, door;
int square = 1, increment = 3, door; for (door = 1; door <= 100; ++door) {
for (door = 1; door <= 100; ++door) printf("door #%d", door);
{
printf("door #%d", door); if (door == square) {
if (door == square) printf(" is open.");
{ square += increment;
printf(" is open."); increment += 2;
square += increment; } else {
increment += 2; printf(" is closed.");
}
} }
else
printf(" is closed.");
}
return 0; return 0;
} }
""" """
samples['c-sharp'] =""" samples['c-sharp'] = """
// Creates and initializes a new integer Array // Creates and initializes a new integer Array
int[] intArray = new int[5] { 1, 2, 3, 4, 5 }; int[] intArray = new int[5] { 1, 2, 3, 4, 5 };
//same as //same as
int[] intArray = new int[]{ 1, 2, 3, 4, 5 }; int[] intArray = new int[]{ 1, 2, 3, 4, 5 };
//same as //same as
int[] intArray = { 1, 2, 3, 4, 5 }; int[] intArray = { 1, 2, 3, 4, 5 };
//Arrays are zero-based //Arrays are zero-based
string[] stringArr = new string[5]; string[] stringArr = new string[5];
stringArr[0] = "string"; stringArr[0] = "string";
@ -162,21 +164,21 @@ samples['html'] = """
<html> <html>
<body> <body>
<table border="1"> <table border="1">
<caption>Monthly savings</caption> <caption>Monthly savings</caption>
<tr> <tr>
<th>Month</th> <th>Month</th>
<th>Savings</th> <th>Savings</th>
</tr> </tr>
<tr> <tr>
<td>January</td> <td>January</td>
<td>$100</td> <td>$100</td>
</tr> </tr>
<tr> <tr>
<td>February</td> <td>February</td>
<td>$50</td> <td>$50</td>
</tr> </tr>
</table> </table>
</body> </body>
</html> </html>
@ -218,22 +220,20 @@ print 'hello world';
# samples['proto'] = """ # samples['proto'] = """
samples['python'] = """ samples['python'] = """
def on_save_clicked(self, param): def on_save_clicked(self, param):
if not self.currentSchemeFile: if not self.currentSchemeFile:
filename = runSaveAsDialog(self.window, self.entryId.get_text() + '.xml')
filename = runSaveAsDialog(self.window, self.entryId.get_text() + '.xml')
if filename and not '.' in os.path.basename(filename):
if filename and not '.' in os.path.basename(filename): filename = filename + '.xml'
filename = filename + '.xml'
if filename:
if filename: self.write_scheme(filename, self.entryId.get_text())
self.write_scheme(filename, self.entryId.get_text()) self.currentSchemeFile = filename
self.currentSchemeFile = filename else:
self.write_scheme(self.currentSchemeFile, self.entryId.get_text())
else:
self.write_scheme(self.currentSchemeFile, self.entryId.get_text()) # TODO handle case where there is a permissions issue
# TODO handle case where there is a permissions issue
""" """
# samples['r'] = """ # samples['r'] = """

View File

@ -22,134 +22,146 @@
<object class="GtkListStore" id="styles_list"> <object class="GtkListStore" id="styles_list">
<columns> <columns>
<!-- column-name Styles --> <!-- column-name Styles -->
<column type="gchar"/> <column type="gchararray"/>
</columns> </columns>
</object> </object>
<object class="GtkBox" id="glade_box"> <object class="GtkBox" id="glade_box">
<property name="width-request">600</property>
<property name="height-request">800</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<child> <child>
<object class="GtkMenuBar"> <object class="GtkBox" id="menu_box">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<child> <child>
<object class="GtkMenuItem"> <object class="GtkMenuBar">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">_File</property> <child>
<property name="use-underline">True</property> <object class="GtkMenuItem">
<child type="submenu">
<object class="GtkMenu">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<child> <property name="label" translatable="yes">_File</property>
<object class="GtkImageMenuItem"> <property name="use-underline">True</property>
<property name="label">gtk-open</property> <child type="submenu">
<object class="GtkMenu">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="use-underline">True</property> <child>
<property name="use-stock">True</property> <object class="GtkImageMenuItem">
<signal name="activate" handler="on_open_clicked" swapped="no"/> <property name="label">gtk-open</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-save</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="use-underline">True</property>
<property name="use-stock">True</property>
<signal name="activate" handler="on_save_clicked" swapped="no"/>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-save-as</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="use-underline">True</property>
<property name="use-stock">True</property>
<signal name="activate" handler="on_save_as_clicked" swapped="no"/>
</object>
</child>
<child>
<object class="GtkMenuItem">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Debug</property>
<property name="use-underline">True</property>
<child type="submenu">
<object class="GtkMenu">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<child> <property name="use-underline">True</property>
<object class="GtkImageMenuItem"> <property name="use-stock">True</property>
<property name="label">Interactive Debug</property> <signal name="activate" handler="on_open_clicked" swapped="no"/>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-save</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="use-underline">True</property>
<property name="use-stock">True</property>
<signal name="activate" handler="on_save_clicked" swapped="no"/>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-save-as</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="use-underline">True</property>
<property name="use-stock">True</property>
<signal name="activate" handler="on_save_as_clicked" swapped="no"/>
</object>
</child>
<child>
<object class="GtkMenuItem">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Debug</property>
<property name="use-underline">True</property>
<child type="submenu">
<object class="GtkMenu">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="image">image1</property> <child>
<property name="use-stock">False</property> <object class="GtkImageMenuItem">
<signal name="activate" handler="_interactive_debug" swapped="no"/> <property name="label">Interactive Debug</property>
</object> <property name="visible">True</property>
</child> <property name="can-focus">False</property>
<child> <property name="image">image1</property>
<object class="GtkImageMenuItem"> <property name="use-stock">False</property>
<property name="label">Transparancy Controls</property> <signal name="activate" handler="_interactive_debug" swapped="no"/>
<property name="visible">True</property> </object>
<property name="can-focus">False</property> </child>
<property name="image">image2</property> <child>
<property name="use-stock">False</property> <object class="GtkImageMenuItem">
<property name="label">Transparancy Controls</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="image">image2</property>
<property name="use-stock">False</property>
</object>
</child>
</object> </object>
</child> </child>
</object> </object>
</child> </child>
</object> <child>
</child> <object class="GtkSeparatorMenuItem">
<child> <property name="visible">True</property>
<object class="GtkSeparatorMenuItem"> <property name="can-focus">False</property>
<property name="visible">True</property> </object>
<property name="can-focus">False</property> </child>
</object> <child>
</child> <object class="GtkImageMenuItem">
<child> <property name="label">gtk-quit</property>
<object class="GtkImageMenuItem"> <property name="visible">True</property>
<property name="label">gtk-quit</property> <property name="can-focus">False</property>
<property name="visible">True</property> <property name="use-underline">True</property>
<property name="can-focus">False</property> <property name="use-stock">True</property>
<property name="use-underline">True</property> <signal name="activate" handler="_close_app" swapped="no"/>
<property name="use-stock">True</property> </object>
<signal name="activate" handler="_close_app" swapped="no"/> </child>
</object> </object>
</child> </child>
</object> </object>
</child> </child>
</object> <child>
</child> <object class="GtkMenuItem">
<child>
<object class="GtkMenuItem">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_Help</property>
<property name="use-underline">True</property>
<child type="submenu">
<object class="GtkMenu">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<child> <property name="label" translatable="yes">_Help</property>
<object class="GtkImageMenuItem"> <property name="use-underline">True</property>
<property name="label">gtk-about</property> <child type="submenu">
<object class="GtkMenu">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="use-underline">True</property> <child>
<property name="use-stock">True</property> <object class="GtkImageMenuItem">
<property name="label">gtk-about</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="use-underline">True</property>
<property name="use-stock">True</property>
</object>
</child>
</object> </object>
</child> </child>
</object> </object>
</child> </child>
</object> </object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child> </child>
</object> </object>
<packing> <packing>
@ -162,6 +174,9 @@
<object class="GtkBox"> <object class="GtkBox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="margin-bottom">5</property>
<property name="spacing">12</property> <property name="spacing">12</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
@ -189,21 +204,28 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkTreeView" id="styles_treeview"> <object class="GtkScrolledWindow">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="model">styles_list</property> <property name="shadow-type">in</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
<child> <child>
<object class="GtkTreeViewColumn"> <object class="GtkTreeView" id="styles_treeview">
<property name="title" translatable="yes">Styles</property> <property name="visible">True</property>
<property name="can-focus">True</property>
<property name="model">styles_list</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
<child> <child>
<object class="GtkCellRendererText"/> <object class="GtkTreeViewColumn">
<attributes> <property name="title" translatable="yes">Styles</property>
<attribute name="text">0</attribute> <child>
</attributes> <object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child> </child>
</object> </object>
</child> </child>
@ -486,7 +508,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property> <property name="label" translatable="yes">Name</property>
<property name="xalign">0.019999999552965164</property> <property name="xalign">2.2351741291171123e-10</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -509,8 +531,9 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="margin-top">5</property>
<property name="label" translatable="yes">Id</property> <property name="label" translatable="yes">Id</property>
<property name="xalign">0.019999999552965164</property> <property name="xalign">0</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -533,8 +556,9 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="margin-top">5</property>
<property name="label" translatable="yes">Description</property> <property name="label" translatable="yes">Description</property>
<property name="xalign">0.019999999552965164</property> <property name="xalign">2.2351741291171123e-10</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -557,8 +581,11 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="margin-top">5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="label" translatable="yes">Author</property> <property name="label" translatable="yes">Author</property>
<property name="xalign">0.019999999552965164</property> <property name="xalign">2.2351741291171123e-10</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -600,8 +627,9 @@
<object class="GtkLabel" id="sample_lbl"> <object class="GtkLabel" id="sample_lbl">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="margin-top">5</property>
<property name="label" translatable="yes">Sample</property> <property name="label" translatable="yes">Sample</property>
<property name="xalign">0.019999999552965164</property> <property name="xalign">0</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 850 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 925 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 882 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 707 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 798 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 989 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB