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

View File

@ -22,134 +22,146 @@
<object class="GtkListStore" id="styles_list">
<columns>
<!-- column-name Styles -->
<column type="gchar"/>
<column type="gchararray"/>
</columns>
</object>
<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="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkMenuBar">
<object class="GtkBox" id="menu_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkMenuItem">
<object class="GtkMenuBar">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">_File</property>
<property name="use-underline">True</property>
<child type="submenu">
<object class="GtkMenu">
<child>
<object class="GtkMenuItem">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-open</property>
<property name="label" translatable="yes">_File</property>
<property name="use-underline">True</property>
<child type="submenu">
<object class="GtkMenu">
<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_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">
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-open</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkImageMenuItem">
<property name="label">Interactive Debug</property>
<property name="use-underline">True</property>
<property name="use-stock">True</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="can-focus">False</property>
<property name="image">image1</property>
<property name="use-stock">False</property>
<signal name="activate" handler="_interactive_debug" swapped="no"/>
</object>
</child>
<child>
<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>
<child>
<object class="GtkImageMenuItem">
<property name="label">Interactive Debug</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="image">image1</property>
<property name="use-stock">False</property>
<signal name="activate" handler="_interactive_debug" swapped="no"/>
</object>
</child>
<child>
<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>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-quit</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="_close_app" swapped="no"/>
<child>
<object class="GtkSeparatorMenuItem">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-quit</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="_close_app" swapped="no"/>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
<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">
<child>
<object class="GtkMenuItem">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-about</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="can-focus">False</property>
<property name="use-underline">True</property>
<property name="use-stock">True</property>
<child>
<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>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
@ -162,6 +174,9 @@
<object class="GtkBox">
<property name="visible">True</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>
<child>
<object class="GtkBox">
@ -189,21 +204,28 @@
</packing>
</child>
<child>
<object class="GtkTreeView" id="styles_treeview">
<object class="GtkScrolledWindow">
<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>
<property name="shadow-type">in</property>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Styles</property>
<object class="GtkTreeView" id="styles_treeview">
<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>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Styles</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
@ -486,7 +508,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Name</property>
<property name="xalign">0.019999999552965164</property>
<property name="xalign">2.2351741291171123e-10</property>
</object>
<packing>
<property name="expand">False</property>
@ -509,8 +531,9 @@
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-top">5</property>
<property name="label" translatable="yes">Id</property>
<property name="xalign">0.019999999552965164</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
@ -533,8 +556,9 @@
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-top">5</property>
<property name="label" translatable="yes">Description</property>
<property name="xalign">0.019999999552965164</property>
<property name="xalign">2.2351741291171123e-10</property>
</object>
<packing>
<property name="expand">False</property>
@ -557,8 +581,11 @@
<object class="GtkLabel">
<property name="visible">True</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="xalign">0.019999999552965164</property>
<property name="xalign">2.2351741291171123e-10</property>
</object>
<packing>
<property name="expand">False</property>
@ -600,8 +627,9 @@
<object class="GtkLabel" id="sample_lbl">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-top">5</property>
<property name="label" translatable="yes">Sample</property>
<property name="xalign">0.019999999552965164</property>
<property name="xalign">0</property>
</object>
<packing>
<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