Browse Source

ThePimp: the "New" button now works.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2890 92316355-f0b4-4df1-b90c-862c8a59935f
remotes/tiles
sam 16 years ago
parent
commit
136e337cdd
6 changed files with 248 additions and 12 deletions
  1. +15
    -0
      ThePimp/MainWindow.cs
  2. +2
    -0
      ThePimp/Makefile.am
  3. +2
    -0
      ThePimp/ThePimp.mdp
  4. +1
    -6
      ThePimp/gtk-gui/ThePimp.MainWindow.cs
  5. +1
    -0
      ThePimp/gtk-gui/ThePimp.ToolBox.cs
  6. +227
    -6
      ThePimp/gtk-gui/gui.stetic

+ 15
- 0
ThePimp/MainWindow.cs View File

@@ -49,6 +49,21 @@ namespace ThePimp
}
}

protected virtual void OnNewActionActivated (object sender, System.EventArgs e)
{
NewFile dialog = new NewFile();
Pipi.Picture p = dialog.New();
dialog.Destroy();
if(p != null)
{
while(notebook1.NPages > 0)
notebook1.RemovePage(0);
int n = notebook1.AppendPage(new PictureView(p),
new Label(p.FileName));
notebook1.Page = n;
}
}

protected virtual void OnQuitActionActivated (object sender, System.EventArgs e)
{
Application.Quit ();


+ 2
- 0
ThePimp/Makefile.am View File

@@ -6,6 +6,7 @@ pimp_sources = \
AboutWindow.cs \
MainWindow.cs \
OpenFile.cs \
NewFile.cs \
PictureView.cs \
SaveFile.cs \
ToolBox.cs \
@@ -13,6 +14,7 @@ pimp_sources = \
gtk-gui/ThePimp.AboutWindow.cs \
gtk-gui/ThePimp.MainWindow.cs \
gtk-gui/ThePimp.OpenFile.cs \
gtk-gui/ThePimp.NewFile.cs \
gtk-gui/ThePimp.PictureView.cs \
gtk-gui/ThePimp.SaveFile.cs \
gtk-gui/ThePimp.ToolBox.cs


+ 2
- 0
ThePimp/ThePimp.mdp View File

@@ -41,6 +41,8 @@
<File name="images/about.png" subtype="Code" buildaction="EmbedAsResource" />
<File name="AboutWindow.cs" subtype="Code" buildaction="Compile" />
<File name="gtk-gui/ThePimp.AboutWindow.cs" subtype="Code" buildaction="Compile" />
<File name="NewFile.cs" subtype="Code" buildaction="Compile" />
<File name="gtk-gui/ThePimp.NewFile.cs" subtype="Code" buildaction="Compile" />
</Contents>
<References>
<ProjectReference type="Gac" localcopy="True" refto="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />


+ 1
- 6
ThePimp/gtk-gui/ThePimp.MainWindow.cs View File

@@ -19,8 +19,6 @@ namespace ThePimp {
private Gtk.Action saveAction;
private Gtk.Action Action;
private Gtk.Action FileAction;
private Gtk.Action EditAction;
@@ -95,15 +93,12 @@ namespace ThePimp {
Gtk.UIManager w1 = new Gtk.UIManager();
Gtk.ActionGroup w2 = new Gtk.ActionGroup("Default");
this.newAction = new Gtk.Action("newAction", null, null, "gtk-new");
this.newAction.Sensitive = false;
w2.Add(this.newAction, null);
this.openAction = new Gtk.Action("openAction", null, null, "gtk-open");
w2.Add(this.openAction, null);
this.saveAction = new Gtk.Action("saveAction", null, null, "gtk-save");
this.saveAction.Sensitive = false;
w2.Add(this.saveAction, null);
this.Action = new Gtk.Action("Action", null, null, null);
w2.Add(this.Action, null);
this.FileAction = new Gtk.Action("FileAction", Mono.Unix.Catalog.GetString("File"), null, null);
this.FileAction.ShortLabel = Mono.Unix.Catalog.GetString("File");
w2.Add(this.FileAction, null);
@@ -117,7 +112,6 @@ namespace ThePimp {
this.HelpAction.ShortLabel = Mono.Unix.Catalog.GetString("Help");
w2.Add(this.HelpAction, null);
this.NewAction = new Gtk.Action("NewAction", Mono.Unix.Catalog.GetString("_New"), null, "gtk-new");
this.NewAction.Sensitive = false;
this.NewAction.ShortLabel = Mono.Unix.Catalog.GetString("_New");
w2.Add(this.NewAction, null);
this.OpenAction = new Gtk.Action("OpenAction", Mono.Unix.Catalog.GetString("_Open"), null, "gtk-open");
@@ -273,6 +267,7 @@ namespace ThePimp {
this.DefaultHeight = 680;
this.Show();
this.DeleteEvent += new Gtk.DeleteEventHandler(this.OnDeleteEvent);
this.newAction.Activated += new System.EventHandler(this.OnNewActionActivated);
this.openAction.Activated += new System.EventHandler(this.OnOpenActionActivated);
this.OpenAction.Activated += new System.EventHandler(this.OnOpenActionActivated);
this.QuitAction.Activated += new System.EventHandler(this.OnQuitActionActivated);


+ 1
- 0
ThePimp/gtk-gui/ThePimp.ToolBox.cs View File

@@ -167,6 +167,7 @@ namespace ThePimp {
// Container child vbox2.Gtk.Box+BoxChild
this.button13 = new Gtk.Button();
this.button13.CanFocus = true;
this.button13.Name = "button13";
// Container child button13.Gtk.Container+ContainerChild
this.image8 = new Gtk.Image();
this.image8.Name = "image8";


+ 227
- 6
ThePimp/gtk-gui/gui.stetic View File

@@ -12,8 +12,8 @@
<action id="newAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes" />
<property name="Sensitive">False</property>
<property name="StockId">gtk-new</property>
<signal name="Activated" handler="OnNewActionActivated" />
</action>
<action id="openAction">
<property name="Type">Action</property>
@@ -27,10 +27,6 @@
<property name="Sensitive">False</property>
<property name="StockId">gtk-save</property>
</action>
<action id="Action">
<property name="Type">Action</property>
<property name="Label" translatable="yes" />
</action>
<action id="FileAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes">File</property>
@@ -54,7 +50,6 @@
<action id="NewAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes">_New</property>
<property name="Sensitive">False</property>
<property name="ShortLabel" translatable="yes">_New</property>
<property name="StockId">gtk-new</property>
</action>
@@ -755,4 +750,230 @@
</widget>
</child>
</widget>
<widget class="Gtk.Dialog" id="ThePimp.NewFile" design-size="400 300">
<property name="MemberName" />
<property name="Title" translatable="yes">New Image</property>
<property name="Icon">stock:gtk-new Menu</property>
<property name="WindowPosition">CenterOnParent</property>
<property name="Buttons">2</property>
<property name="HelpButton">False</property>
<property name="HasSeparator">False</property>
<child internal-child="VBox">
<widget class="Gtk.VBox" id="dialog1_VBox">
<property name="MemberName" />
<property name="BorderWidth">2</property>
<child>
<widget class="Gtk.VBox" id="vbox2">
<property name="MemberName" />
<property name="Spacing">6</property>
<property name="BorderWidth">5</property>
<child>
<widget class="Gtk.ComboBox" id="combobox1">
<property name="MemberName" />
<property name="IsTextCombo">True</property>
<property name="Items" translatable="yes">Random Noise
Bayer Dithering Pattern</property>
<property name="Active">0</property>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Table" id="table1">
<property name="MemberName" />
<property name="NRows">2</property>
<property name="NColumns">3</property>
<property name="RowSpacing">6</property>
<property name="ColumnSpacing">6</property>
<child>
<widget class="Gtk.Entry" id="entry1">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="Text" translatable="yes">1024</property>
<property name="IsEditable">True</property>
<property name="WidthChars">6</property>
<property name="Xalign">1</property>
</widget>
<packing>
<property name="LeftAttach">1</property>
<property name="RightAttach">2</property>
<property name="AutoSize">False</property>
<property name="XOptions">Fill</property>
<property name="YOptions">Fill</property>
<property name="XExpand">False</property>
<property name="XFill">True</property>
<property name="XShrink">False</property>
<property name="YExpand">False</property>
<property name="YFill">True</property>
<property name="YShrink">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Entry" id="entry2">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="Text" translatable="yes">768</property>
<property name="IsEditable">True</property>
<property name="WidthChars">6</property>
<property name="Xalign">1</property>
</widget>
<packing>
<property name="TopAttach">1</property>
<property name="BottomAttach">2</property>
<property name="LeftAttach">1</property>
<property name="RightAttach">2</property>
<property name="AutoSize">False</property>
<property name="XOptions">Fill</property>
<property name="YOptions">Fill</property>
<property name="XExpand">False</property>
<property name="XFill">True</property>
<property name="XShrink">False</property>
<property name="YExpand">False</property>
<property name="YFill">True</property>
<property name="YShrink">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Label" id="label1">
<property name="MemberName" />
<property name="LabelProp" translatable="yes">px</property>
</widget>
<packing>
<property name="LeftAttach">2</property>
<property name="RightAttach">3</property>
<property name="AutoSize">True</property>
<property name="XOptions">Fill</property>
<property name="YOptions">Fill</property>
<property name="XExpand">False</property>
<property name="XFill">True</property>
<property name="XShrink">False</property>
<property name="YExpand">False</property>
<property name="YFill">True</property>
<property name="YShrink">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Label" id="label2">
<property name="MemberName" />
<property name="LabelProp" translatable="yes">px</property>
</widget>
<packing>
<property name="TopAttach">1</property>
<property name="BottomAttach">2</property>
<property name="LeftAttach">2</property>
<property name="RightAttach">3</property>
<property name="AutoSize">True</property>
<property name="XOptions">Fill</property>
<property name="YOptions">Fill</property>
<property name="XExpand">False</property>
<property name="XFill">True</property>
<property name="XShrink">False</property>
<property name="YExpand">False</property>
<property name="YFill">True</property>
<property name="YShrink">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Label" id="label3">
<property name="MemberName" />
<property name="LabelProp" translatable="yes">Width</property>
<property name="Justify">Right</property>
</widget>
<packing>
<property name="AutoSize">False</property>
<property name="XOptions">0</property>
<property name="YOptions">Fill</property>
<property name="XExpand">False</property>
<property name="XFill">False</property>
<property name="XShrink">False</property>
<property name="YExpand">False</property>
<property name="YFill">True</property>
<property name="YShrink">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Label" id="label4">
<property name="MemberName" />
<property name="LabelProp" translatable="yes">Height</property>
<property name="Justify">Right</property>
</widget>
<packing>
<property name="TopAttach">1</property>
<property name="BottomAttach">2</property>
<property name="AutoSize">False</property>
<property name="XOptions">0</property>
<property name="YOptions">Fill</property>
<property name="XExpand">False</property>
<property name="XFill">False</property>
<property name="XShrink">False</property>
<property name="YExpand">False</property>
<property name="YFill">True</property>
<property name="YShrink">False</property>
</packing>
</child>
</widget>
<packing>
<property name="Position">1</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
</widget>
</child>
<child internal-child="ActionArea">
<widget class="Gtk.HButtonBox" id="dialog1_ActionArea">
<property name="MemberName" />
<property name="Spacing">6</property>
<property name="BorderWidth">5</property>
<property name="Size">2</property>
<property name="LayoutStyle">End</property>
<child>
<widget class="Gtk.Button" id="buttonCancel">
<property name="MemberName" />
<property name="CanDefault">True</property>
<property name="CanFocus">True</property>
<property name="UseStock">True</property>
<property name="Type">StockItem</property>
<property name="StockId">gtk-cancel</property>
<property name="ResponseId">-6</property>
<property name="label">gtk-cancel</property>
</widget>
<packing>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Button" id="buttonOk">
<property name="MemberName" />
<property name="CanDefault">True</property>
<property name="CanFocus">True</property>
<property name="UseStock">True</property>
<property name="Type">StockItem</property>
<property name="StockId">gtk-ok</property>
<property name="ResponseId">-5</property>
<property name="label">gtk-ok</property>
</widget>
<packing>
<property name="Position">1</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
</stetic-interface>

Loading…
Cancel
Save