Changeset 2875 for libpipi/trunk


Ignore:
Timestamp:
Oct 5, 2008, 11:05:02 PM (12 years ago)
Author:
Sam Hocevar
Message:

ThePimp?: reorganised stuff.

Location:
libpipi/trunk/ThePimp
Files:
1 added
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • libpipi/trunk/ThePimp/MainWindow.cs

    r2874 r2875  
    1818using ThePimp;
    1919
    20 public partial class MainWindow: Gtk.Window
     20namespace ThePimp
    2121{
    22     public MainWindow (): base (Gtk.WindowType.Toplevel)
     22    public partial class MainWindow: Gtk.Window
    2323    {
    24         Build ();
    25         Title += " v" + Libpipi.getVersion();
    26     }
     24        public MainWindow (): base (Gtk.WindowType.Toplevel)
     25        {
     26            Build ();
     27            Title += " v" + Libpipi.getVersion();
     28        }
    2729
    28     protected void OnDeleteEvent (object sender, DeleteEventArgs a)
    29     {
    30         Application.Quit ();
    31         a.RetVal = true;
    32     }
     30        protected void OnDeleteEvent (object sender, DeleteEventArgs a)
     31        {
     32            Application.Quit ();
     33            a.RetVal = true;
     34        }
    3335
    34     protected virtual void OnOpenActionActivated (object sender, System.EventArgs e)
    35     {
    36         ThePimp.OpenFile open = new ThePimp.OpenFile();
    37         Pipi.Picture p = open.Load();
    38         open.Destroy();
    39         if(p != null)
     36        protected virtual void OnOpenActionActivated (object sender, System.EventArgs e)
    4037        {
    41             while(notebook1.NPages > 0)
    42                 notebook1.RemovePage(0);
    43             int n = notebook1.AppendPage(new PictureView(p),
    44                                          new Label(p.FileName));
    45             notebook1.Page = n;
     38            OpenFile open = new OpenFile();
     39            Pipi.Picture p = open.Load();
     40            open.Destroy();
     41            if(p != null)
     42            {
     43                while(notebook1.NPages > 0)
     44                    notebook1.RemovePage(0);
     45                int n = notebook1.AppendPage(new PictureView(p),
     46                                             new Label(p.FileName));
     47                notebook1.Page = n;
     48            }
     49        }
     50
     51        protected virtual void OnQuitActionActivated (object sender, System.EventArgs e)
     52        {
     53            Application.Quit ();
     54        }
     55
     56        protected virtual void OnSaveAsActionActivated (object sender, System.EventArgs e)
     57        {
     58            SaveFile save = new SaveFile();
     59            PictureView view = notebook1.CurrentPageWidget as PictureView;
     60            save.Save(view.Picture);
     61            save.Destroy();
    4662        }
    4763    }
    48 
    49     protected virtual void OnQuitActionActivated (object sender, System.EventArgs e)
    50     {
    51         Application.Quit ();
    52     }
    53 
    54     protected virtual void OnSaveAsActionActivated (object sender, System.EventArgs e)
    55     {
    56         ThePimp.SaveFile save = new ThePimp.SaveFile();
    57         ThePimp.PictureView view = notebook1.CurrentPageWidget as ThePimp.PictureView;
    58         save.Save(view.Picture);
    59         save.Destroy();
    60     }
    6164}
  • libpipi/trunk/ThePimp/Makefile.am

    r2874 r2875  
    66        $(srcdir)/PictureView.cs \
    77        $(srcdir)/gtk-gui/generated.cs \
     8        $(srcdir)/MainWindow.cs \
     9        $(srcdir)/gtk-gui/ThePimp.MainWindow.cs \
    810        $(srcdir)/OpenFile.cs \
    911        $(srcdir)/gtk-gui/ThePimp.OpenFile.cs \
    1012        $(srcdir)/SaveFile.cs \
    1113        $(srcdir)/gtk-gui/ThePimp.SaveFile.cs \
    12         $(srcdir)/MainWindow.cs \
    13         $(srcdir)/gtk-gui/MainWindow.cs
     14        $(srcdir)/ToolBox.cs \
     15        $(srcdir)/gtk-gui/ThePimp.ToolBox.cs
     16
     17pimp_resources = \
     18        gtk-gui/gui.stetic \
     19        gtk-gui/objects.xml
    1420
    1521if USE_CSHARP
     
    1723endif
    1824
    19 EXTRA_DIST = $(pimp_sources)
     25EXTRA_DIST = $(pimp_sources) $(pimp_resources)
    2026
    21 Pimp.exe: $(pimp_sources)
     27Pimp.exe: ../pipi-sharp/pipi-sharp.dll $(pimp_sources) $(pimp_resources)
    2228        cp ../pipi-sharp/pipi-sharp.dll .
    2329        cp ../pipi-sharp/pipi-sharp.dll.config .
    2430        cp ../pipi-sharp/pipi-sharp.dll.mdb .
    25         gmcs -debug $(pimp_sources) -out:$@ -lib:./ \
     31        gmcs -debug -out:$@ -lib:./ \
     32          $(addprefix $(srcdir)/, $(pimp_sources)) \
     33          $(addprefix -resource:$(srcdir)/, $(pimp_resources)) \
    2634          -pkg:gtk-sharp-2.0 -r:Mono.Posix -r:pipi-sharp.dll
    2735
  • libpipi/trunk/ThePimp/ThePimp.mdp

    r2874 r2875  
    2626    <File name="gtk-gui/generated.cs" subtype="Code" buildaction="Compile" />
    2727    <File name="MainWindow.cs" subtype="Code" buildaction="Compile" />
    28     <File name="gtk-gui/MainWindow.cs" subtype="Code" buildaction="Compile" />
     28    <File name="gtk-gui/ThePimp.MainWindow.cs" subtype="Code" buildaction="Compile" />
    2929    <File name="Main.cs" subtype="Code" buildaction="Compile" />
    3030    <File name="AssemblyInfo.cs" subtype="Code" buildaction="Compile" />
    3131    <File name="app.desktop" subtype="Code" buildaction="FileCopy" DeployService.TargetDirectoryId="Linux.DesktopApplications" />
    32     <File name="OpenFile.cs" subtype="Code" buildaction="Compile" />
    3332    <File name="gtk-gui/objects.xml" subtype="Code" buildaction="EmbedAsResource" />
    3433    <File name="PictureView.cs" subtype="Code" buildaction="Compile" />
     34    <File name="gtk-gui/ThePimp.PictureView.cs" subtype="Code" buildaction="Compile" />
     35    <File name="OpenFile.cs" subtype="Code" buildaction="Compile" />
    3536    <File name="gtk-gui/ThePimp.OpenFile.cs" subtype="Code" buildaction="Compile" />
    3637    <File name="ToolBox.cs" subtype="Code" buildaction="Compile" />
    3738    <File name="gtk-gui/ThePimp.ToolBox.cs" subtype="Code" buildaction="Compile" />
    38     <File name="gtk-gui/ThePimp.PictureView.cs" subtype="Code" buildaction="Compile" />
    3939    <File name="SaveFile.cs" subtype="Code" buildaction="Compile" />
    4040    <File name="gtk-gui/ThePimp.SaveFile.cs" subtype="Code" buildaction="Compile" />
  • libpipi/trunk/ThePimp/gtk-gui/ThePimp.OpenFile.cs

    r2869 r2875  
    2525            this.Name = "ThePimp.OpenFile";
    2626            this.Title = Mono.Unix.Catalog.GetString("Open File");
    27             this.Icon = Stetic.IconLoader.LoadIcon(this, "gtk-open", Gtk.IconSize.Menu, 16);
     27            this.Icon = Stetic.IconLoader.LoadIcon(this, "stock_open", Gtk.IconSize.Menu, 16);
    2828            this.TypeHint = ((Gdk.WindowTypeHint)(1));
    2929            this.WindowPosition = ((Gtk.WindowPosition)(4));
     
    7474                this.Child.ShowAll();
    7575            }
    76             this.DefaultWidth = 627;
    77             this.DefaultHeight = 448;
     76            this.DefaultWidth = 640;
     77            this.DefaultHeight = 480;
    7878            this.Show();
    7979        }
  • libpipi/trunk/ThePimp/gtk-gui/ThePimp.SaveFile.cs

    r2874 r2875  
    2424            // Widget ThePimp.SaveFile
    2525            this.Name = "ThePimp.SaveFile";
     26            this.Title = Mono.Unix.Catalog.GetString("Save File");
     27            this.Icon = Stetic.IconLoader.LoadIcon(this, "stock_save", Gtk.IconSize.Menu, 16);
    2628            this.WindowPosition = ((Gtk.WindowPosition)(4));
    2729            this.HasSeparator = false;
     
    7072                this.Child.ShowAll();
    7173            }
    72             this.DefaultWidth = 400;
    73             this.DefaultHeight = 300;
     74            this.DefaultWidth = 640;
     75            this.DefaultHeight = 480;
    7476            this.Show();
    7577        }
  • libpipi/trunk/ThePimp/gtk-gui/ThePimp.ToolBox.cs

    r2874 r2875  
    5858            this.Name = "ThePimp.ToolBox";
    5959            // Container child ThePimp.ToolBox.Gtk.Container+ContainerChild
    60             this.table1 = new Gtk.Table(((uint)(3)), ((uint)(3)), false);
     60            this.table1 = new Gtk.Table(((uint)(4)), ((uint)(4)), false);
    6161            this.table1.Name = "table1";
    6262            this.table1.RowSpacing = ((uint)(6));
  • libpipi/trunk/ThePimp/gtk-gui/gui.stetic

    r2874 r2875  
    88    <widget-library name="../Pimp.exe" internal="true" />
    99  </import>
    10   <widget class="Gtk.Window" id="MainWindow" design-size="840 680">
     10  <widget class="Gtk.Window" id="ThePimp.MainWindow" design-size="840 680">
    1111    <action-group name="Default">
    1212      <action id="newAction">
     
    266266            <property name="MemberName" />
    267267            <property name="CanFocus">True</property>
    268             <property name="Position">408</property>
     268            <property name="Position">639</property>
    269269            <child>
    270270              <widget class="Gtk.Notebook" id="notebook1">
     
    285285                <property name="MemberName" />
    286286                <property name="CanFocus">True</property>
    287                 <property name="Position">60</property>
     287                <property name="Position">76</property>
    288288                <child>
    289289                  <widget class="Gtk.VBox" id="vbox2">
     
    302302                        <property name="Fill">False</property>
    303303                      </packing>
    304                     </child>
    305                     <child>
    306                       <placeholder />
    307304                    </child>
    308305                    <child>
     
    340337                </child>
    341338              </widget>
     339              <packing>
     340                <property name="Resize">False</property>
     341                <property name="Shrink">False</property>
     342              </packing>
    342343            </child>
    343344          </widget>
     
    368369    </child>
    369370  </widget>
    370   <widget class="Gtk.Dialog" id="ThePimp.OpenFile" design-size="627 448">
     371  <widget class="Gtk.Dialog" id="ThePimp.OpenFile" design-size="640 480">
    371372    <property name="MemberName" />
    372373    <property name="Title" translatable="yes">Open File</property>
    373     <property name="Icon">stock:gtk-open Menu</property>
     374    <property name="Icon">stock:stock_open Menu</property>
    374375    <property name="TypeHint">Dialog</property>
    375376    <property name="WindowPosition">CenterOnParent</property>
     
    441442      <widget class="Gtk.Table" id="table1">
    442443        <property name="MemberName" />
    443         <property name="NRows">3</property>
    444         <property name="NColumns">3</property>
     444        <property name="NRows">4</property>
     445        <property name="NColumns">4</property>
    445446        <property name="RowSpacing">6</property>
    446447        <property name="ColumnSpacing">6</property>
     448        <child>
     449          <placeholder />
     450        </child>
     451        <child>
     452          <placeholder />
     453        </child>
     454        <child>
     455          <placeholder />
     456        </child>
     457        <child>
     458          <placeholder />
     459        </child>
     460        <child>
     461          <placeholder />
     462        </child>
     463        <child>
     464          <placeholder />
     465        </child>
     466        <child>
     467          <placeholder />
     468        </child>
    447469        <child>
    448470          <widget class="Gtk.Button" id="button10">
     
    694716    </child>
    695717  </widget>
    696   <widget class="Gtk.Dialog" id="ThePimp.SaveFile" design-size="400 300">
     718  <widget class="Gtk.Dialog" id="ThePimp.SaveFile" design-size="640 480">
    697719    <property name="MemberName" />
     720    <property name="Title" translatable="yes">Save File</property>
     721    <property name="Icon">stock:stock_save Menu</property>
    698722    <property name="WindowPosition">CenterOnParent</property>
    699723    <property name="Buttons">2</property>
Note: See TracChangeset for help on using the changeset viewer.