app.CMDTest = new Command(new Action(() => app.AddWidget (app.instFileDlg.CreateInstance()).DataSource = app)) { Caption = "Test", Icon = new SvgPicture("#Tests.image.blank-file.svg"), CanExecute = true};
//app.AddWidget (@"Interfaces/Divers/testFocus.crow").DataSource = app;
//app.AddWidget (@"Interfaces/Divers/testMenu.crow").DataSource = app;
- app.AddWidget (@"Interfaces/Divers/testVisibility.crow").DataSource = app;
+ //app.AddWidget (@"Interfaces/Divers/testVisibility.crow").DataSource = app;
//app.AddWidget (@"Interfaces/Divers/0.crow").DataSource = app;
//app.AddWidget (@"Interfaces/Splitter/1.crow").DataSource = app;
- //app.AddWidget (@"Interfaces/Container/0.crow").DataSource = app;
+ app.AddWidget (@"Interfaces/GraphicObject/0.crow").DataSource = app;
//app.AddWidget (@"Interfaces/TemplatedContainer/test_Listbox.crow").DataSource = app;
- app.instFileDlg = Crow.IML.Instantiator.CreateFromImlFragment
- (app, "<FileDialog Caption='Open File' CurrentDirectory='{²CurrentDirectory}'/>");
+ /*app.instFileDlg = Crow.IML.Instantiator.CreateFromImlFragment
+ (app, "<FileDialog Caption='Open File' CurrentDirectory='{²CurrentDirectory}'/>");*/
//app.AddWidget (@"Interfaces/Divers/colorPicker.crow").DataSource = app;
<?xml version="1.0"?>
-<GraphicObject Margin="10" Width="Stretched" Height="Stretched" Background="SeaGreen"
- MinimumSize="50,50"/>
\ No newline at end of file
+<GraphicObject Background="SeaGreen"/>
\ No newline at end of file
}
void savingThread(){
while(true){
- if (isDirty) {
- save ();
- isDirty = false;
- }
+ if (isDirty)
+ Save ();
Thread.Sleep (100);
}
}
items[key].Set (value);
isDirty = true;
}
- void save(){
+ public void Save(){
using (Stream s = new FileStream(configPath,FileMode.Create)){
using (StreamWriter sw = new StreamWriter (s)) {
lock (items) {
}
}
}
+ isDirty = false;
}
void load(Stream s){
using (StreamReader sr = new StreamReader (s)) {
protected TextExtents te;
#endregion
+
[XmlAttributeAttribute][DefaultValue("SteelBlue")]
public virtual Color SelectionBackground {
get { return selBackground; }
{
if (!base.PointIsIn (ref m))
return false;
-
+ if (tview == null)//double check this, just added to prevent exception
+ return false;
if (m.Y < tview.TabHeight)
return TabTitle.Slot.ContainsOrIsEqual (m);
else
Keyboard.KeyUp += Keyboard_KeyUp;
Keyboard.KeyPress += Keyboard_KeyPress;
- /*initTooltip ();
- initContextMenus ();*/
+ initTooltip ();
+ initContextMenus ();
running = true;
t.IsBackground = true;
t.Start ();
}
-
+ public void Run () {
+ while (running) {
+ ProcessEvents ();
+ Thread.Sleep(1);
+ }
+ }
void Keyboard_KeyPress (object sender, KeyPressEventArgs e)
{
if (_focusedWidget != null)
#endregion
#region operators
- public static implicit operator Rectangle(System.Drawing.Rectangle r)
- {
- return new Rectangle(r.X, r.Y, r.Width, r.Height);
- }
- public static implicit operator System.Drawing.Rectangle(Rectangle r)
- {
- return new System.Drawing.Rectangle(r.X, r.Y, r.Width, r.Height);
- }
public static Rectangle operator +(Rectangle r1, Rectangle r2)
{
int x = Math.Min(r1.X, r2.X);