using System.Windows.Media.Animation;\r
using System.Windows.Media.Imaging;\r
using System.Windows.Shapes;\r
+using System.Windows.Browser;\r
+\r
\r
\r
\r
namespace Psychlops\r
{\r
\r
+ /*\r
+ class Widget : public Figure {\r
+ public:\r
+ class Event {\r
+ public:\r
+ };\r
+ };\r
+ * */\r
+\r
namespace Widgets\r
{\r
+ /*\r
+ struct Theme {\r
+ static bool initialized__;\r
+ static Image default_button, default_horiz_grad;\r
+ enum TYPE_TAG { NORMAL, ALERT };\r
+ public:\r
+ Color normal_foreground[2], active_foreground[2];\r
+ Color normal_background[2], active_background[2], over_background[2];\r
+ Stroke normal_stroke[2], active_stroke[2];\r
+ Image button_back, *horiz_grad;\r
+\r
+ static Theme current;\r
+ static void initialize();\r
+ };\r
+ * */\r
+\r
+ /*\r
+ class WidgetRect : Widget\r
+ {\r
+ protected:\r
+ HumanInterfaceDevice::ButtonStateHolder mleft;\r
+ bool pushed_;\r
+\r
+ public:\r
+ //Theme *theme;\r
+ //Theme::TYPE_TAG theme_type;\r
+ public Rectangle area;\r
+ public Letters label;\r
+\r
+ public abstract WidgetRect();\r
+ public virtual const Point getDatum() const;\r
+ public virtual WidgetRect& setDatum(const Point&);\r
+ public virtual WidgetRect& centering(const Point&);\r
+ public double getWidth() const;\r
+ public double getHeight() const;\r
+ public double getLeft() const;\r
+ public double getTop() const;\r
+ public double getRight() const;\r
+ public double getBottom() const;\r
+ public WidgetRect& alignLeft(const double lef);\r
+ public WidgetRect& alignTop(const double to_);\r
+ public WidgetRect& alignRight(const double rig);\r
+ public WidgetRect& alignBottom(const double bot);\r
+\r
+ public virtual WidgetRect& set(double wid, double hei);\r
+ public virtual WidgetRect& set(std::wstring name);\r
+ public virtual WidgetRect& set(std::wstring name, double hei);\r
+ public virtual WidgetRect& setLabel(std::wstring s);\r
+ public virtual WidgetRect& draw(Drawable &target = *Drawable::prime);\r
+ public bool pushed();\r
+ public WidgetRect& pushThis();\r
+ };\r
+ */\r
+ /*\r
+ public class Slider\r
+ {\r
+ public Rectangle outer;\r
+ }\r
+ */\r
\r
public class Slider\r
{\r
}\r
\r
\r
+ public class Browser\r
+ {\r
+ public class Element\r
+ {\r
+ HtmlElement elem;\r
+ System.Object retval;\r
+\r
+ public Element()\r
+ {\r
+ retval = 0;\r
+ }\r
+\r
+ public static Element byID(string id_tag)\r
+ {\r
+ return getElementById(id_tag);\r
+ }\r
+ public static Element getElementById(string id_tag)\r
+ {\r
+ Element tmp = new Element();\r
+ Internal.Main.widgetStack.Dispatcher.BeginInvoke(new Connector.VoidString(tmp.getElementById__), id_tag);\r
+ return tmp;\r
+ }\r
+ void getElementById__(string id_tag)\r
+ {\r
+ elem = HtmlPage.Document.GetElementById(id_tag);\r
+ }\r
+\r
+ public void setProperty(string name, System.Object value)\r
+ {\r
+ Internal.Main.widgetStack.Dispatcher.BeginInvoke(new Connector.VoidStringObject(setProperty__), name, value);\r
+ }\r
+ public void setProperty__(string name, System.Object value)\r
+ {\r
+ elem.SetProperty(name, value);\r
+ }\r
+\r
+\r
+ public static implicit operator double(Element i) { return i.getValueAsDouble(); }\r
+ public double getValueAsDouble()\r
+ {\r
+ double v = 0;\r
+ getProperty("value");\r
+ try\r
+ {\r
+ v = double.Parse(retval.ToString());\r
+ }\r
+ catch (FormatException e)\r
+ {\r
+ v = 0;\r
+ }\r
+ return v;\r
+ }\r
+\r
+ public static implicit operator string(Element i) { return i.getProperty("value").ToString(); }\r
+ public System.Object getProperty(string name)\r
+ {\r
+ Internal.Main.widgetStack.Dispatcher.BeginInvoke(new Connector.VoidString(getProperty__), name);\r
+ return retval;\r
+ }\r
+ public void getProperty__(string name)\r
+ {\r
+ retval = elem.GetProperty(name);\r
+ }\r
+ }\r
+ }\r
+\r
\r
\r
internal static class Connector\r
{\r
+ internal delegate void VoidString(string s);\r
+ internal delegate void VoidStringObject(String s, System.Object o);\r
+ \r
+\r
+\r
delegate void StackSlider_(Slider s);\r
internal static void stackSlider(Slider s)\r
{\r