///** Get window caption widget */ internal TextBox GetCaptionWidget() { if (null == mCaption) { Instance inst = ICall_getCaptionWidget(mInstance.Ptr); if (inst.IsValid) { int temp = mInstance.Ptr.ToInt32() + inst.Ptr.ToInt32(); string name = mName + "_" + Widget.GetName(inst.Ptr) + "_" + temp.ToString(); mCaption = new TextBox(inst, name, mParentLayout); mParentLayout.AddWidget(mCaption); } } return mCaption; }
internal static Widget CreateWidget(Instance inst, FString name, Layout parent_layout) { WidgetType type = ICall_getType(inst.Ptr); Widget widget = null; switch (type) { case WidgetType.Widget: widget = new Widget(inst, name, parent_layout, WidgetType.Widget); break; case WidgetType.ImageBox: widget = new ImageBox(inst, name, parent_layout); break; case WidgetType.Window: widget = new Window(inst, name, parent_layout); break; case WidgetType.TextBox: widget = new TextBox(inst, name, parent_layout); break; case WidgetType.ListBox: widget = new ListBox(inst, name, parent_layout); break; case WidgetType.Button: widget = new Button(inst, name, parent_layout); break; case WidgetType.EditBox: widget = new EditBox(inst, name, parent_layout); break; case WidgetType.ComboBox: widget = new ComboBox(inst, name, parent_layout); break; case WidgetType.ScrollBar: widget = new ScrollBar(inst, name, parent_layout); break; case WidgetType.DDContainer: widget = new DDContainer(inst, name, parent_layout); break; case WidgetType.ItemBox: widget = new ItemBox(inst, name, parent_layout); break; case WidgetType.Canvas: widget = new Canvas(inst, name, parent_layout); break; default: widget = new Widget(inst, name, parent_layout, WidgetType.Unknown); break; } return widget; }