Skip to content

Commit

Permalink
Small steps forward
Browse files Browse the repository at this point in the history
  • Loading branch information
joerg committed Jun 28, 2008
1 parent 9bbfc91 commit 9b75399
Show file tree
Hide file tree
Showing 8 changed files with 276 additions and 118 deletions.
4 changes: 4 additions & 0 deletions tools/Jeton/ChangeLog
@@ -1,3 +1,7 @@
2008-06-28 Jörg Bornschein <joerg@das-labor.org>



2008-06-26 Jörg Bornschein <joerg@das-labor.org>


Expand Down
Binary file modified tools/Jeton/Jeton/Jeton.pidb
Binary file not shown.
6 changes: 3 additions & 3 deletions tools/Jeton/JetonAdmin/JetonAdmin.mdp
Expand Up @@ -21,9 +21,9 @@
<File name="AssemblyInfo.cs" subtype="Code" buildaction="Compile" />
<File name="gtk-gui/JetonAdmin.MainWindow.cs" subtype="Code" buildaction="Compile" />
<File name="Screens" subtype="Directory" buildaction="Compile" />
<File name="Screens/CardScreen.cs" subtype="Code" buildaction="Compile" />
<File name="gtk-gui/JetonAdmin.CardScreen.cs" subtype="Code" buildaction="Compile" />
<File name="Screens/UserScreen.cs" subtype="Code" buildaction="Compile" />
<File name="gtk-gui/objects.xml" subtype="Code" buildaction="EmbedAsResource" />
<File name="gtk-gui/JetonAdmin.UserScreen.cs" subtype="Code" buildaction="Compile" />
</Contents>
<References>
<ProjectReference type="Gac" localcopy="True" refto="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
Expand All @@ -39,7 +39,7 @@
<Deployment.LinuxDeployData scriptName="jeton-admin" />
<GtkDesignInfo gtkVersion="2.12.0">
<ExportedWidgets>
<Widget>JetonAdmin.CardScreen</Widget>
<Widget>JetonAdmin.UserScreen</Widget>
</ExportedWidgets>
</GtkDesignInfo>
</Project>
Expand Up @@ -5,12 +5,12 @@

namespace JetonAdmin
{
public partial class CardScreen : Gtk.Bin
public partial class UserScreen : Gtk.Bin
{
ListStore cardList;
Person currentPerson;

public CardScreen()
public UserScreen()
{
this.Build();

Expand All @@ -21,7 +21,7 @@ public CardScreen()
cardListView.Model = cardList;
cardListView.Selection.Changed += OnSelectionChanged;

UpdatePanel();
Db2Gui();
}

void UpdateCardList()
Expand All @@ -31,40 +31,7 @@ void UpdateCardList()
cardList.AppendValues( p, p.Name );
}
}

void UpdatePanel()
{
if (currentPerson == null) {
cardIdEntry.Sensitive = false;
cardNameEntry.Sensitive = false;
cardCreditEntry.Sensitive = false;
cardEscrowEntry.Sensitive = false;
} else {
cardIdEntry.Sensitive = true;
cardNameEntry.Sensitive = true;
cardCreditEntry.Sensitive = true;
cardEscrowEntry.Sensitive = true;

cardIdEntry.Text = currentPerson.Id.ToString();
cardNameEntry.Text = currentPerson.Name;
cardCreditEntry.Text = currentPerson.Deposit.ToString();
cardEscrowEntry.Text = currentPerson.Escrow.ToString();
}
}

void OnSelectionChanged(object o, EventArgs args)
{
TreeIter iter;

if (cardListView.Selection.GetSelected(out iter)) {
currentPerson = cardList.GetValue (iter, 0) as Person;

} else {
currentPerson = null;
}
UpdatePanel();
}

void OnCardAdd (object sender, System.EventArgs e)
{
TreeIter iter;
Expand All @@ -79,26 +46,69 @@ void OnCardAdd (object sender, System.EventArgs e)
void OnCardDelete (object sender, System.EventArgs e)
{
}

void OnNameEntryChanged (object sender, System.EventArgs e)

void OnSelectionChanged(object o, EventArgs args)
{
TreeIter iter;

if (cardListView.Selection.GetSelected(out iter)) {
currentPerson = cardList.GetValue (iter, 0) as Person;
} else {
currentPerson = null;
}
Db2Gui();
}

void OnChanged (object sender, System.EventArgs e)
{
// Update CardListView
/*
TreeIter iter;
if (cardListView.Selection.GetSelected(out iter)) {
cardList.SetValue(iter, 1, cardNameEntry.Text);
}
*/

undoBtn.Sensitive = true;
}

void OnSaveClicked (object sender, System.EventArgs e)
void Gui2Db()
{
Console.WriteLine( "EditDone" );
Console.WriteLine( "Db2Gui" );

currentPerson.Name = cardNameEntry.Text;
currentPerson.Deposit = decimal.Parse( cardCreditEntry.Text );
currentPerson.Escrow = decimal.Parse( cardEscrowEntry.Text );

JetonCtrl.SavePerson( currentPerson );
undoBtn.Sensitive = false;
}

void Db2Gui()
{
if (currentPerson == null) {
cardIdEntry.Sensitive = false;
cardNameEntry.Sensitive = false;
cardCreditEntry.Sensitive = false;
cardEscrowEntry.Sensitive = false;
} else {
cardIdEntry.Sensitive = true;
cardNameEntry.Sensitive = true;
cardCreditEntry.Sensitive = true;
cardEscrowEntry.Sensitive = true;

cardIdEntry.Text = currentPerson.Id.ToString();
cardNameEntry.Text = currentPerson.Name;
cardCreditEntry.Text = currentPerson.Deposit.ToString();
cardEscrowEntry.Text = currentPerson.Escrow.ToString();
}
undoBtn.Sensitive = false;
}

void OnUndoClicked (object sender, System.EventArgs e)
{
Db2Gui();
}

}
Expand Down
18 changes: 9 additions & 9 deletions tools/Jeton/JetonAdmin/gtk-gui/JetonAdmin.MainWindow.cs
Expand Up @@ -27,7 +27,7 @@ public partial class MainWindow {

private Gtk.Notebook notebook1;

private JetonAdmin.CardScreen cardscreen1;
private JetonAdmin.UserScreen userscreen1;

private Gtk.Label label1;

Expand Down Expand Up @@ -77,26 +77,26 @@ public partial class MainWindow {
this.notebook1 = new Gtk.Notebook();
this.notebook1.CanFocus = true;
this.notebook1.Name = "notebook1";
this.notebook1.CurrentPage = 0;
this.notebook1.CurrentPage = 1;
this.notebook1.EnablePopup = true;
// Container child notebook1.Gtk.Notebook+NotebookChild
this.cardscreen1 = new JetonAdmin.CardScreen();
this.cardscreen1.Events = ((Gdk.EventMask)(256));
this.cardscreen1.Name = "cardscreen1";
this.notebook1.Add(this.cardscreen1);
this.userscreen1 = new JetonAdmin.UserScreen();
this.userscreen1.Events = ((Gdk.EventMask)(256));
this.userscreen1.Name = "userscreen1";
this.notebook1.Add(this.userscreen1);
// Notebook tab
this.label1 = new Gtk.Label();
this.label1.Name = "label1";
this.label1.LabelProp = Mono.Unix.Catalog.GetString("Karten");
this.notebook1.SetTabLabel(this.cardscreen1, this.label1);
this.label1.LabelProp = Mono.Unix.Catalog.GetString("Benutzer");
this.notebook1.SetTabLabel(this.userscreen1, this.label1);
this.label1.ShowAll();
// Notebook tab
Gtk.Label w5 = new Gtk.Label();
w5.Visible = true;
this.notebook1.Add(w5);
this.label5 = new Gtk.Label();
this.label5.Name = "label5";
this.label5.LabelProp = Mono.Unix.Catalog.GetString("Bestand");
this.label5.LabelProp = Mono.Unix.Catalog.GetString("Artikel Bestand");
this.notebook1.SetTabLabel(w5, this.label5);
this.label5.ShowAll();
// Notebook tab
Expand Down

0 comments on commit 9b75399

Please sign in to comment.