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

@ -10,10 +10,11 @@ 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 begin
for I in 1..100 loop for I in 1..100 loop
for J in The_Doors'range loop for J in The_Doors'range loop
@ -26,27 +27,28 @@ with Ada.Text_Io; use Ada.Text_Io;
end if; end if;
end loop; end loop;
end loop; end loop;
for I in The_Doors'range loop for I in The_Doors'range loop
Put_Line(Integer'Image(I) & " is " & Door_State'Image(The_Doors(I))); Put_Line(Integer'Image(I) & " is " & Door_State'Image(The_Doors(I)));
end loop; end loop;
end Doors; 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,16 +57,17 @@ 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++) {
for(i = 1; i <= 100; i++) {
if ( int(sqrt(i)) == sqrt(i) ) { if ( int(sqrt(i)) == sqrt(i) ) {
doors[i] = 1 doors[i] = 1
} }
} }
for(i=1; i <= 100; i++)
{ for(i = 1; i <= 100; i++) {
print i, doors[i] ? "open" : "close" print i, doors[i] ? "open" : "close"
} }
} }
@ -79,26 +82,25 @@ 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."); printf(" is open.");
square += increment; square += increment;
increment += 2; increment += 2;
} } else {
else
printf(" is closed."); 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
@ -162,7 +164,7 @@ 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>
@ -176,7 +178,7 @@ samples['html'] = """
<td>February</td> <td>February</td>
<td>$50</td> <td>$50</td>
</tr> </tr>
</table> </table>
</body> </body>
</html> </html>
@ -220,7 +222,6 @@ print 'hello world';
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):
@ -229,7 +230,6 @@ samples['python'] = """
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: else:
self.write_scheme(self.currentSchemeFile, self.entryId.get_text()) self.write_scheme(self.currentSchemeFile, self.entryId.get_text())

View File

@ -22,15 +22,17 @@
<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>
<object class="GtkBox" id="menu_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child> <child>
<object class="GtkMenuBar"> <object class="GtkMenuBar">
<property name="visible">True</property> <property name="visible">True</property>
@ -158,10 +160,23 @@
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child> <child>
<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">
@ -188,6 +203,11 @@
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child> <child>
<object class="GtkTreeView" id="styles_treeview"> <object class="GtkTreeView" id="styles_treeview">
<property name="visible">True</property> <property name="visible">True</property>
@ -208,6 +228,8 @@
</object> </object>
</child> </child>
</object> </object>
</child>
</object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
@ -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