[longomatch/redesign3: 140/156] Add widgets for tags
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch/redesign3: 140/156] Add widgets for tags
- Date: Wed, 17 Aug 2011 22:27:58 +0000 (UTC)
commit aeb6b4ab89cf486fcd7582a78640dae46d56ac21
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Thu Jun 2 00:02:57 2011 +0200
Add widgets for tags
LongoMatch/Gui/Component/PlayersTaggerWidget.cs | 86 +++++++++++
LongoMatch/Gui/Component/StringTaggerWidget.cs | 83 +++++++++++
LongoMatch/Gui/Component/SubCategoryTagsEditor.cs | 30 ++++
LongoMatch/Gui/Component/TaggerWidget.cs | 92 ++-----------
LongoMatch/Gui/Component/TagsTreeWidget.cs | 19 ++-
LongoMatch/Gui/Dialog/SubCategoryEditor.cs | 108 ++++++++++++++
LongoMatch/Gui/Dialog/TaggerDialog.cs | 17 ++-
LongoMatch/Handlers/EventsManager.cs | 2 +
LongoMatch/LongoMatch.mdp | 4 +
...LongoMatch.Gui.Component.PlayersTaggerWidget.cs | 39 +++++
.../LongoMatch.Gui.Component.StringTaggerWidget.cs | 46 ++++++
.../LongoMatch.Gui.Component.TaggerWidget.cs | 75 +---------
.../gtk-gui/LongoMatch.Gui.Dialog.TaggerDialog.cs | 2 -
LongoMatch/gtk-gui/gui.stetic | 148 ++++++++++++--------
14 files changed, 534 insertions(+), 217 deletions(-)
---
diff --git a/LongoMatch/Gui/Component/PlayersTaggerWidget.cs b/LongoMatch/Gui/Component/PlayersTaggerWidget.cs
new file mode 100644
index 0000000..91f2c0b
--- /dev/null
+++ b/LongoMatch/Gui/Component/PlayersTaggerWidget.cs
@@ -0,0 +1,86 @@
+//
+// Copyright (C) 2011 Andoni Morales Alastruey
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+using System;
+using System.Collections.Generic;
+using Gtk;
+
+using LongoMatch.Store;
+using LongoMatch.Store.Templates;
+
+namespace LongoMatch.Gui.Component
+{
+ [System.ComponentModel.ToolboxItem(true)]
+ public partial class PlayersTaggerWidget : Gtk.Bin
+ {
+ TeamTemplate template;
+ Dictionary<CheckButton, Player> checkButtonsDict;
+
+ public PlayersTaggerWidget ()
+ {
+ this.Build ();
+ checkButtonsDict = new Dictionary<CheckButton, Player>();
+ }
+
+ public void SetPlayersInfo(TeamTemplate template) {
+ CheckButton button;
+ List<Player> playersList;
+ int i=0;
+
+ if(this.template != null)
+ return;
+
+ this.template = template;
+ playersList = template.PlayingPlayersList;
+
+ table1.NColumns =(uint)(playersList.Count/10);
+ table1.NRows =(uint) 10;
+
+ foreach(Player player in playersList) {
+ button = new CheckButton();
+ button.Label = player.Number + "-" + player.Name;
+ button.Name = i.ToString();
+ button.Show();
+
+ uint row_top =(uint)(i%table1.NRows);
+ uint row_bottom = (uint) row_top+1 ;
+ uint col_left = (uint) i/table1.NRows;
+ uint col_right = (uint) col_left+1 ;
+
+ table1.Attach(button,col_left,col_right,row_top,row_bottom);
+ checkButtonsDict.Add(button, player);
+ i++;
+ }
+ }
+
+ public List<Player> PlayersChecked {
+ set {
+ foreach(var pair in checkButtonsDict)
+ pair.Key.Active = value.Contains(pair.Value);
+ }
+ get {
+ List<Player> playersList = new List<Player>();
+ foreach(var pair in checkButtonsDict) {
+ if(pair.Key.Active)
+ playersList.Add(pair.Value);
+ }
+ return playersList;
+ }
+ }
+ }
+}
+
diff --git a/LongoMatch/Gui/Component/StringTaggerWidget.cs b/LongoMatch/Gui/Component/StringTaggerWidget.cs
new file mode 100644
index 0000000..62c44db
--- /dev/null
+++ b/LongoMatch/Gui/Component/StringTaggerWidget.cs
@@ -0,0 +1,83 @@
+//
+// Copyright (C) 2011 Andoni Morales Alastruey
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+using System;
+using System.Linq;
+using System.Collections.Generic;
+using Gtk;
+
+using LongoMatch.Store;
+
+namespace LongoMatch.Gui.Component
+{
+ [System.ComponentModel.ToolboxItem(true)]
+ public partial class StringTaggerWidget : Gtk.Bin
+ {
+ private Dictionary<StringTag, CheckButton> dict;
+ private List<StringTag> tags;
+ string subcategory;
+
+ public StringTaggerWidget ()
+ {
+ this.Build ();
+ dict = new Dictionary<StringTag, CheckButton>();
+ }
+
+ public TagSubCategory SubCategory {
+ set {
+ subcategory = value.Name;
+ Title = subcategory;
+ foreach (string tag in value)
+ AddTagWidget(new StringTag{Value=tag});
+ }
+ }
+
+ public List<StringTag> Tags {
+ set{
+ tags = value;
+ foreach (var tag in tags) {
+ if (dict.ContainsKey(tag))
+ dict[tag].Active = true;
+ }
+ }
+ get {
+ return tags;
+ }
+ }
+
+ private void AddTagWidget (StringTag tag){
+ var button = new CheckButton(tag.Value);
+ button.Toggled += delegate(object sender, EventArgs e) {
+ if (button.Active) {
+ if (tags.Contains(tag))
+ tags.Add(tag);
+ } else
+ tags.Remove(tag);
+ };
+ dict.Add(tag, button);
+ buttonsbox.PackStart(button, true, false, 0);
+ button.ShowAll();
+ }
+
+ private string Title {
+ set {
+ titlelabel.Markup = "<b>" + value + "</b>";
+ }
+ }
+ }
+}
+
diff --git a/LongoMatch/Gui/Component/SubCategoryTagsEditor.cs b/LongoMatch/Gui/Component/SubCategoryTagsEditor.cs
new file mode 100644
index 0000000..6108a6e
--- /dev/null
+++ b/LongoMatch/Gui/Component/SubCategoryTagsEditor.cs
@@ -0,0 +1,30 @@
+//
+// Copyright (C) 2011 Andoni Morales Alastruey
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+using System;
+namespace LongoMatch.Gui.Component
+{
+ [System.ComponentModel.ToolboxItem(true)]
+ public partial class SubCategoryTagsEditor : Gtk.Bin
+ {
+ public SubCategoryTagsEditor ()
+ {
+ this.Build ();
+ }
+ }
+}
+
diff --git a/LongoMatch/Gui/Component/TaggerWidget.cs b/LongoMatch/Gui/Component/TaggerWidget.cs
index 86c15b3..141639b 100644
--- a/LongoMatch/Gui/Component/TaggerWidget.cs
+++ b/LongoMatch/Gui/Component/TaggerWidget.cs
@@ -29,91 +29,21 @@ namespace LongoMatch.Gui.Component
[System.ComponentModel.ToolboxItem(true)]
public partial class TaggerWidget : Gtk.Bin
{
- private Dictionary<Tag, CheckButton> tagsDict;
-
public TaggerWidget()
{
this.Build();
- tagsDict = new Dictionary<Tag, CheckButton>();
- table1.NColumns = 5;
- }
-
-
- public List<Tag> Tags {
- set {
- CheckButton button = null;
- foreach(Tag tag in value) {
- if(tagsDict.TryGetValue(tag, out button))
- button.Active = true;
- }
- }
- get {
- List<Tag> list = new List<Tag>();
- foreach(KeyValuePair<Tag, CheckButton> pair in tagsDict) {
- if(pair.Value.Active)
- list.Add(pair.Key);
- }
- return list;
- }
- }
-
- private void AddTag(string text, bool check) {
- Tag tag = new Tag {
- Value = text,
- };
- if(tagsDict.ContainsKey(tag))
- return;
- AddTagWidget(tag, check);
- }
-
- private void AddTagWidget(Tag tag, bool check) {
- CheckButton button = new CheckButton(tag.Value.ToString());
- button.Name = tag.Value.ToString();
- AddElementToTable(button);
- button.Active = check;
- tagsDict.Add(tag, button);
- }
-
- private void AddElementToTable(CheckButton button) {
- uint row_top,row_bottom,col_left,col_right;
- int index = tagsDict.Count;
-
- table1.NRows =(uint)(index/5 + 1);
- row_top =(uint)(index/table1.NColumns);
- row_bottom = (uint) row_top+1 ;
- col_left = (uint) index%table1.NColumns;
- col_right = (uint) col_left+1 ;
-
- table1.Attach(button,col_left,col_right,row_top,row_bottom);
- button.Show();
+ table1.NColumns = 1;
+ table1.NRows = 1;
}
-
- protected virtual void OnTagbuttonClicked(object sender, System.EventArgs e)
- {
- Tag tag;
- CheckButton button;
-
- // Don't allow tags with void strings
- if(entry1.Text == "")
- return;
- // Check if it's the first tag and show the tags table
- if(tagsDict.Count == 0) {
- scrolledwindow1.Visible = true;
- label1.Visible = false;
- }
- tag = new Tag {
- Value = entry1.Text,
- };
- if(tagsDict.TryGetValue(tag, out button))
- button.Active = true;
- else
- AddTag(entry1.Text, true);
- entry1.Text = "";
- }
-
- protected virtual void OnEntry1Activated(object sender, System.EventArgs e)
- {
- tagbutton.Click();
+
+ public void AddSubCategory(TagSubCategory subcat, List<StringTag> tags){
+ StringTaggerWidget tagger = new StringTaggerWidget();
+ tagger.SubCategory = subcat;
+ tagger.Tags = tags;
+
+ table1.Attach(tagger,0, 1, table1.NRows-1, table1.NRows);
+ table1.NRows ++;
+ tagger.Show();
}
}
}
\ No newline at end of file
diff --git a/LongoMatch/Gui/Component/TagsTreeWidget.cs b/LongoMatch/Gui/Component/TagsTreeWidget.cs
index 9fec3b4..fba92a6 100644
--- a/LongoMatch/Gui/Component/TagsTreeWidget.cs
+++ b/LongoMatch/Gui/Component/TagsTreeWidget.cs
@@ -33,6 +33,17 @@ namespace LongoMatch.Gui.Component
AND = 1
}
+ public class Tag:List<string>
+ {
+ public string Value {
+ set {
+
+ }
+ get {
+ return "";
+ }
+ }
+ }
[System.ComponentModel.Category("LongoMatch")]
[System.ComponentModel.ToolboxItem(true)]
@@ -135,8 +146,8 @@ namespace LongoMatch.Gui.Component
public void UpdateTagsList() {
(tagscombobox.Model as ListStore).Clear();
- foreach(Tag tag in project.Tags)
- tagscombobox.AppendText(tag.Value.ToString());
+ //foreach(Tag tag in project.Tags)
+ // tagscombobox.AppendText(tag.Value.ToString());
}
private void AddFilterWidget(Tag tag) {
@@ -203,13 +214,13 @@ namespace LongoMatch.Gui.Component
if(filterType == FilterType.OR) {
foreach(Tag tag in filterTags) {
- if(tNode.Tags.Contains(tag))
+ // if(tNode.Tags.Contains(tag))
return true;
}
return false;
} else {
foreach(Tag tag in filterTags) {
- if(! tNode.Tags.Contains(tag))
+ //if(! tNode.Tags.Contains(tag))
return false;
}
return true;
diff --git a/LongoMatch/Gui/Dialog/SubCategoryEditor.cs b/LongoMatch/Gui/Dialog/SubCategoryEditor.cs
new file mode 100644
index 0000000..63aa028
--- /dev/null
+++ b/LongoMatch/Gui/Dialog/SubCategoryEditor.cs
@@ -0,0 +1,108 @@
+//
+// Copyright (C) 2011 Andoni Morales Alastruey
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+using System;
+using Gtk;
+using Mono.Unix;
+using LongoMatch.Store;
+
+namespace LongoMatch.Gui.Dialog
+{
+ public partial class SubCategoryEditor : Gtk.Dialog
+ {
+ private TagSubCategory subcat;
+
+ public SubCategoryEditor ()
+ {
+ this.Build ();
+ }
+
+ public TagSubCategory SubCategory{
+ set {
+ ListStore store = new ListStore(typeof (string));
+ foreach (string tag in value.Options)
+ store.AppendValues(tag);
+ subcat = value;
+ }
+ get {
+ return subcat;
+ }
+ }
+
+ protected virtual void OnDeletebuttonClicked (object sender, System.EventArgs e)
+ {
+ TreeIter iter;
+ string tag;
+
+ if (!treeview1.Selection.GetSelected(out iter))
+ return;
+ tag = (string)treeview1.Model.GetValue(iter, 0);
+ SubCategory.Options.Remove(tag);
+ (treeview1.Model as ListStore).Remove(ref iter);
+ }
+
+ protected virtual void OnEditbuttonClicked (object sender, System.EventArgs e)
+ {
+ EntryDialog nameDialog;
+ string old_option, new_option;
+ TreeIter iter;
+
+ if (!treeview1.Selection.GetSelected(out iter))
+ return;
+
+ old_option = (string)treeview1.Model.GetValue(iter, 0);
+
+ nameDialog = new EntryDialog();
+ nameDialog.ShowCount = false;
+ nameDialog.Text = old_option;
+ if (nameDialog.Run() == (int)ResponseType.Ok) {
+ new_option = nameDialog.Text;
+ if (new_option != old_option) {
+ SubCategory.Options.Remove(old_option);
+ SubCategory.Options.Add(new_option);
+ old_option = new_option;
+ }
+ }
+ nameDialog.Dispose();
+ }
+
+ protected virtual void OnAddbuttonClicked (object sender, System.EventArgs e)
+ {
+ EntryDialog nameDialog = new EntryDialog();
+ nameDialog.ShowCount = false;
+ if (nameDialog.Run() == (int)ResponseType.Ok) {
+ SubCategory.Options.Add(nameDialog.Text);
+ (treeview1.Model as ListStore).AppendValues(nameDialog.Text);
+ }
+ nameDialog.Dispose();
+ }
+
+ protected virtual void OnEntry1Changed (object sender, System.EventArgs e)
+ {
+ SubCategory.Name = nameentry.Text;
+ }
+
+ protected virtual void OnTreeview1RowActivated (object o, Gtk.RowActivatedArgs args)
+ {
+ }
+
+ protected virtual void OnTreeview1CursorChanged (object sender, System.EventArgs e)
+ {
+ }
+ }
+}
+
diff --git a/LongoMatch/Gui/Dialog/TaggerDialog.cs b/LongoMatch/Gui/Dialog/TaggerDialog.cs
index 85824e0..8304f3b 100644
--- a/LongoMatch/Gui/Dialog/TaggerDialog.cs
+++ b/LongoMatch/Gui/Dialog/TaggerDialog.cs
@@ -17,6 +17,7 @@
//
using System;
+using System.Linq;
using System.Collections.Generic;
using LongoMatch.Store;
using LongoMatch.Store.Templates;
@@ -28,11 +29,23 @@ namespace LongoMatch.Gui.Dialog
public partial class TaggerDialog : Gtk.Dialog
{
- public TaggerDialog()
+ public TaggerDialog(Category cat, StringTagStore tags)
{
this.Build();
buttonOk.Visible = false;
+
+ foreach (var subcat in cat.SubCategories) {
+ if (subcat is TagSubCategory) {
+ var tagcat = subcat as TagSubCategory;
+ if (!tags.Contains(tagcat))
+ continue;
+ AddSubcategory(tagcat, tags.GetTags(tagcat));
+ }
+ }
+ }
+
+ public void AddSubcategory (TagSubCategory subcat, List<StringTag> tags){
+ taggerwidget1.AddSubCategory(subcat, tags);
}
-
}
}
diff --git a/LongoMatch/Handlers/EventsManager.cs b/LongoMatch/Handlers/EventsManager.cs
index 5eabbb5..54f0c1e 100644
--- a/LongoMatch/Handlers/EventsManager.cs
+++ b/LongoMatch/Handlers/EventsManager.cs
@@ -195,6 +195,8 @@ namespace LongoMatch
else
miniature = null;
var play = openedProject.AddPlay(category, start, stop,miniature);
+ TaggerDialog tg = new TaggerDialog(category, play.Tags);
+ tg.Run();
treewidget.AddPlay(play);
tagsTreeWidget.AddPlay(play);
timeline.AddPlay(play);
diff --git a/LongoMatch/LongoMatch.mdp b/LongoMatch/LongoMatch.mdp
index 1412d96..ff2ab02 100644
--- a/LongoMatch/LongoMatch.mdp
+++ b/LongoMatch/LongoMatch.mdp
@@ -193,6 +193,10 @@
<File subtype="Directory" buildaction="Compile" name="Utils" />
<File subtype="Code" buildaction="Compile" name="Gui/Dialog/SubCategoryTagsEditor.cs" />
<File subtype="Code" buildaction="Compile" name="gtk-gui/LongoMatch.Gui.Dialog.SubCategoryTagsEditor.cs" />
+ <File subtype="Code" buildaction="Compile" name="Gui/Component/PlayersTaggerWidget.cs" />
+ <File subtype="Code" buildaction="Compile" name="gtk-gui/LongoMatch.Gui.Component.PlayersTaggerWidget.cs" />
+ <File subtype="Code" buildaction="Compile" name="Gui/Component/StringTaggerWidget.cs" />
+ <File subtype="Code" buildaction="Compile" name="gtk-gui/LongoMatch.Gui.Component.StringTaggerWidget.cs" />
</Contents>
<References>
<ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
diff --git a/LongoMatch/gtk-gui/LongoMatch.Gui.Component.PlayersTaggerWidget.cs b/LongoMatch/gtk-gui/LongoMatch.Gui.Component.PlayersTaggerWidget.cs
new file mode 100644
index 0000000..4225eaf
--- /dev/null
+++ b/LongoMatch/gtk-gui/LongoMatch.Gui.Component.PlayersTaggerWidget.cs
@@ -0,0 +1,39 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace LongoMatch.Gui.Component
+{
+ public partial class PlayersTaggerWidget
+ {
+ private global::Gtk.ScrolledWindow scrolledwindow1;
+
+ private global::Gtk.Table table1;
+
+ protected virtual void Build ()
+ {
+ global::Stetic.Gui.Initialize (this);
+ // Widget LongoMatch.Gui.Component.PlayersTaggerWidget
+ global::Stetic.BinContainer.Attach (this);
+ this.Name = "LongoMatch.Gui.Component.PlayersTaggerWidget";
+ // Container child LongoMatch.Gui.Component.PlayersTaggerWidget.Gtk.Container+ContainerChild
+ this.scrolledwindow1 = new global::Gtk.ScrolledWindow ();
+ this.scrolledwindow1.CanFocus = true;
+ this.scrolledwindow1.Name = "scrolledwindow1";
+ this.scrolledwindow1.ShadowType = ((global::Gtk.ShadowType)(1));
+ // Container child scrolledwindow1.Gtk.Container+ContainerChild
+ global::Gtk.Viewport w1 = new global::Gtk.Viewport ();
+ w1.ShadowType = ((global::Gtk.ShadowType)(0));
+ // Container child GtkViewport.Gtk.Container+ContainerChild
+ this.table1 = new global::Gtk.Table (((uint)(3)), ((uint)(3)), false);
+ this.table1.Name = "table1";
+ this.table1.RowSpacing = ((uint)(6));
+ this.table1.ColumnSpacing = ((uint)(6));
+ w1.Add (this.table1);
+ this.scrolledwindow1.Add (w1);
+ this.Add (this.scrolledwindow1);
+ if ((this.Child != null)) {
+ this.Child.ShowAll ();
+ }
+ this.Hide ();
+ }
+ }
+}
diff --git a/LongoMatch/gtk-gui/LongoMatch.Gui.Component.StringTaggerWidget.cs b/LongoMatch/gtk-gui/LongoMatch.Gui.Component.StringTaggerWidget.cs
new file mode 100644
index 0000000..ec3758a
--- /dev/null
+++ b/LongoMatch/gtk-gui/LongoMatch.Gui.Component.StringTaggerWidget.cs
@@ -0,0 +1,46 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace LongoMatch.Gui.Component
+{
+ public partial class StringTaggerWidget
+ {
+ private global::Gtk.Frame frame;
+
+ private global::Gtk.Alignment GtkAlignment;
+
+ private global::Gtk.HButtonBox buttonsbox;
+
+ private global::Gtk.Label titlelabel;
+
+ protected virtual void Build ()
+ {
+ global::Stetic.Gui.Initialize (this);
+ // Widget LongoMatch.Gui.Component.StringTaggerWidget
+ global::Stetic.BinContainer.Attach (this);
+ this.Name = "LongoMatch.Gui.Component.StringTaggerWidget";
+ // Container child LongoMatch.Gui.Component.StringTaggerWidget.Gtk.Container+ContainerChild
+ this.frame = new global::Gtk.Frame ();
+ this.frame.Name = "frame";
+ this.frame.ShadowType = ((global::Gtk.ShadowType)(0));
+ // Container child frame.Gtk.Container+ContainerChild
+ this.GtkAlignment = new global::Gtk.Alignment (0f, 0f, 1f, 1f);
+ this.GtkAlignment.Name = "GtkAlignment";
+ this.GtkAlignment.LeftPadding = ((uint)(12));
+ // Container child GtkAlignment.Gtk.Container+ContainerChild
+ this.buttonsbox = new global::Gtk.HButtonBox ();
+ this.buttonsbox.Name = "buttonsbox";
+ this.GtkAlignment.Add (this.buttonsbox);
+ this.frame.Add (this.GtkAlignment);
+ this.titlelabel = new global::Gtk.Label ();
+ this.titlelabel.Name = "titlelabel";
+ this.titlelabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>GtkFrame</b>");
+ this.titlelabel.UseMarkup = true;
+ this.frame.LabelWidget = this.titlelabel;
+ this.Add (this.frame);
+ if ((this.Child != null)) {
+ this.Child.ShowAll ();
+ }
+ this.Hide ();
+ }
+ }
+}
diff --git a/LongoMatch/gtk-gui/LongoMatch.Gui.Component.TaggerWidget.cs b/LongoMatch/gtk-gui/LongoMatch.Gui.Component.TaggerWidget.cs
index 2942355..0fb880e 100644
--- a/LongoMatch/gtk-gui/LongoMatch.Gui.Component.TaggerWidget.cs
+++ b/LongoMatch/gtk-gui/LongoMatch.Gui.Component.TaggerWidget.cs
@@ -6,18 +6,10 @@ namespace LongoMatch.Gui.Component
{
private global::Gtk.VBox vbox2;
- private global::Gtk.Label label1;
-
private global::Gtk.ScrolledWindow scrolledwindow1;
private global::Gtk.Table table1;
- private global::Gtk.HBox hbox1;
-
- private global::Gtk.Entry entry1;
-
- private global::Gtk.Button tagbutton;
-
protected virtual void Build ()
{
global::Stetic.Gui.Initialize (this);
@@ -29,84 +21,29 @@ namespace LongoMatch.Gui.Component
this.vbox2.Name = "vbox2";
this.vbox2.Spacing = 6;
// Container child vbox2.Gtk.Box+BoxChild
- this.label1 = new global::Gtk.Label ();
- this.label1.Name = "label1";
- this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>You haven't tagged any play yet.</b>\nYou can add new tags using the text entry and clicking \"Add Tag\"");
- this.label1.UseMarkup = true;
- this.label1.Justify = ((global::Gtk.Justification)(2));
- this.vbox2.Add (this.label1);
- global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.label1]));
- w1.Position = 0;
- // Container child vbox2.Gtk.Box+BoxChild
this.scrolledwindow1 = new global::Gtk.ScrolledWindow ();
this.scrolledwindow1.CanFocus = true;
this.scrolledwindow1.Name = "scrolledwindow1";
this.scrolledwindow1.ShadowType = ((global::Gtk.ShadowType)(1));
// Container child scrolledwindow1.Gtk.Container+ContainerChild
- global::Gtk.Viewport w2 = new global::Gtk.Viewport ();
- w2.ShadowType = ((global::Gtk.ShadowType)(0));
+ global::Gtk.Viewport w1 = new global::Gtk.Viewport ();
+ w1.ShadowType = ((global::Gtk.ShadowType)(0));
// Container child GtkViewport.Gtk.Container+ContainerChild
this.table1 = new global::Gtk.Table (((uint)(3)), ((uint)(3)), false);
this.table1.Name = "table1";
this.table1.RowSpacing = ((uint)(6));
this.table1.ColumnSpacing = ((uint)(6));
- w2.Add (this.table1);
- this.scrolledwindow1.Add (w2);
+ w1.Add (this.table1);
+ this.scrolledwindow1.Add (w1);
this.vbox2.Add (this.scrolledwindow1);
- global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.scrolledwindow1]));
- w5.Position = 1;
- // Container child vbox2.Gtk.Box+BoxChild
- this.hbox1 = new global::Gtk.HBox ();
- this.hbox1.Name = "hbox1";
- this.hbox1.Spacing = 6;
- // Container child hbox1.Gtk.Box+BoxChild
- this.entry1 = new global::Gtk.Entry ();
- this.entry1.CanFocus = true;
- this.entry1.Name = "entry1";
- this.entry1.IsEditable = true;
- this.entry1.InvisibleChar = 'â';
- this.hbox1.Add (this.entry1);
- global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.entry1]));
- w6.Position = 0;
- // Container child hbox1.Gtk.Box+BoxChild
- this.tagbutton = new global::Gtk.Button ();
- this.tagbutton.CanFocus = true;
- this.tagbutton.Name = "tagbutton";
- this.tagbutton.UseUnderline = true;
- // Container child tagbutton.Gtk.Container+ContainerChild
- global::Gtk.Alignment w7 = new global::Gtk.Alignment (0.5f, 0.5f, 0f, 0f);
- // Container child GtkAlignment.Gtk.Container+ContainerChild
- global::Gtk.HBox w8 = new global::Gtk.HBox ();
- w8.Spacing = 2;
- // Container child GtkHBox.Gtk.Container+ContainerChild
- global::Gtk.Image w9 = new global::Gtk.Image ();
- w9.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-add", global::Gtk.IconSize.Dialog);
- w8.Add (w9);
- // Container child GtkHBox.Gtk.Container+ContainerChild
- global::Gtk.Label w11 = new global::Gtk.Label ();
- w11.LabelProp = global::Mono.Unix.Catalog.GetString ("Add Tag");
- w11.UseUnderline = true;
- w8.Add (w11);
- w7.Add (w8);
- this.tagbutton.Add (w7);
- this.hbox1.Add (this.tagbutton);
- global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.tagbutton]));
- w15.Position = 1;
- w15.Expand = false;
- w15.Fill = false;
- this.vbox2.Add (this.hbox1);
- global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox1]));
- w16.Position = 2;
- w16.Expand = false;
- w16.Fill = false;
+ global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.scrolledwindow1]));
+ w4.Position = 0;
this.Add (this.vbox2);
if ((this.Child != null)) {
this.Child.ShowAll ();
}
this.scrolledwindow1.Hide ();
this.Hide ();
- this.entry1.Activated += new global::System.EventHandler (this.OnEntry1Activated);
- this.tagbutton.Clicked += new global::System.EventHandler (this.OnTagbuttonClicked);
}
}
}
diff --git a/LongoMatch/gtk-gui/LongoMatch.Gui.Dialog.TaggerDialog.cs b/LongoMatch/gtk-gui/LongoMatch.Gui.Dialog.TaggerDialog.cs
index 239fa45..1b4ae12 100644
--- a/LongoMatch/gtk-gui/LongoMatch.Gui.Dialog.TaggerDialog.cs
+++ b/LongoMatch/gtk-gui/LongoMatch.Gui.Dialog.TaggerDialog.cs
@@ -27,8 +27,6 @@ namespace LongoMatch.Gui.Dialog
w1.Add (this.taggerwidget1);
global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(w1[this.taggerwidget1]));
w2.Position = 0;
- w2.Expand = false;
- w2.Fill = false;
// Internal child LongoMatch.Gui.Dialog.TaggerDialog.ActionArea
global::Gtk.HButtonBox w3 = this.ActionArea;
w3.Name = "dialog1_ActionArea";
diff --git a/LongoMatch/gtk-gui/gui.stetic b/LongoMatch/gtk-gui/gui.stetic
index 250933e..afbe107 100644
--- a/LongoMatch/gtk-gui/gui.stetic
+++ b/LongoMatch/gtk-gui/gui.stetic
@@ -5402,19 +5402,6 @@ Show-><b> S</b>
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
- <widget class="Gtk.Label" id="label1">
- <property name="MemberName" />
- <property name="LabelProp" translatable="yes"><b>You haven't tagged any play yet.</b>
-You can add new tags using the text entry and clicking "Add Tag"</property>
- <property name="UseMarkup">True</property>
- <property name="Justify">Center</property>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">False</property>
- </packing>
- </child>
- <child>
<widget class="Gtk.ScrolledWindow" id="scrolledwindow1">
<property name="MemberName" />
<property name="Visible">False</property>
@@ -5464,50 +5451,8 @@ You can add new tags using the text entry and clicking "Add Tag"</property>
</child>
</widget>
<packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.HBox" id="hbox1">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <child>
- <widget class="Gtk.Entry" id="entry1">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="IsEditable">True</property>
- <property name="InvisibleChar">â</property>
- <signal name="Activated" handler="OnEntry1Activated" />
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Button" id="tagbutton">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Type">TextAndIcon</property>
- <property name="Icon">stock:gtk-add Dialog</property>
- <property name="Label" translatable="yes">Add Tag</property>
- <property name="UseUnderline">True</property>
- <signal name="Clicked" handler="OnTagbuttonClicked" />
- </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">2</property>
+ <property name="Position">0</property>
<property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
</packing>
</child>
</widget>
@@ -5531,9 +5476,7 @@ You can add new tags using the text entry and clicking "Add Tag"</property>
</widget>
<packing>
<property name="Position">0</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
+ <property name="AutoSize">False</property>
</packing>
</child>
</widget>
@@ -6321,4 +6264,91 @@ You can continue with the current capture, cancel it or save your project.
</widget>
</child>
</widget>
+ <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.PlayersTaggerWidget" design-size="300 300">
+ <property name="MemberName" />
+ <property name="Visible">False</property>
+ <child>
+ <widget class="Gtk.ScrolledWindow" id="scrolledwindow1">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="ShadowType">In</property>
+ <child>
+ <widget class="Gtk.Viewport" id="GtkViewport">
+ <property name="MemberName" />
+ <property name="ShadowType">None</property>
+ <child>
+ <widget class="Gtk.Table" id="table1">
+ <property name="MemberName" />
+ <property name="NRows">3</property>
+ <property name="NColumns">3</property>
+ <property name="RowSpacing">6</property>
+ <property name="ColumnSpacing">6</property>
+ <child>
+ <placeholder />
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.StringTaggerWidget" design-size="300 98">
+ <property name="MemberName" />
+ <property name="Visible">False</property>
+ <child>
+ <widget class="Gtk.Frame" id="frame">
+ <property name="MemberName" />
+ <property name="ShadowType">None</property>
+ <child>
+ <widget class="Gtk.Alignment" id="GtkAlignment">
+ <property name="MemberName" />
+ <property name="Xalign">0</property>
+ <property name="Yalign">0</property>
+ <property name="LeftPadding">12</property>
+ <child>
+ <widget class="Gtk.HButtonBox" id="buttonsbox">
+ <property name="MemberName" />
+ <property name="Size">0</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="titlelabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes"><b>GtkFrame</b></property>
+ <property name="UseMarkup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
</stetic-interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]