aboutsummaryrefslogtreecommitdiff
path: root/Src/Wasabi/api/skin/widgets/xuitabsheet.h
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
committerJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Wasabi/api/skin/widgets/xuitabsheet.h
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/Wasabi/api/skin/widgets/xuitabsheet.h')
-rw-r--r--Src/Wasabi/api/skin/widgets/xuitabsheet.h91
1 files changed, 91 insertions, 0 deletions
diff --git a/Src/Wasabi/api/skin/widgets/xuitabsheet.h b/Src/Wasabi/api/skin/widgets/xuitabsheet.h
new file mode 100644
index 00000000..efb17222
--- /dev/null
+++ b/Src/Wasabi/api/skin/widgets/xuitabsheet.h
@@ -0,0 +1,91 @@
+#ifndef __SCRIPTTABSHEET_H
+#define __SCRIPTTABSHEET_H
+
+#include <api/wnd/wndclass/typesheet.h>
+#include <api/script/objcontroller.h>
+
+#define SCRIPTTABSHEET_PARENT TypeSheet
+
+// -----------------------------------------------------------------------
+// Your wnd object class
+
+class ScriptTabSheet : public SCRIPTTABSHEET_PARENT {
+
+ public:
+
+ ScriptTabSheet();
+ virtual ~ScriptTabSheet();
+
+ // XuiObject automatically calls this back for all parameters registered using addParam
+ // encountered in the xml source
+ virtual int setXuiParam(int xuihandle, int xmlattributeid, const wchar_t *xmlattributename, const wchar_t *value);
+
+ void setWindowType(const wchar_t *elementname);
+ void setChildrenIds(const wchar_t *paramvalue);
+ void setType(const wchar_t *element);
+ virtual int onInit();
+
+ void setContentMarginX(const wchar_t *value, int what);
+protected:
+ void CreateXMLParameters(int master_handle);
+ private:
+
+ // a list of IDs for our xml attributes, we use them in addParam() in the constructor
+ enum {
+ SCRIPTTABSHEET_SETWINDOWTYPE = 0,
+ SCRIPTTABSHEET_SETCHILDREN,
+ SCRIPTTABSHEET_SETTYPE,
+ SCRIPTTABSHEET_SETCONTENTMARGINLEFT,
+ SCRIPTTABSHEET_SETCONTENTMARGINTOP,
+ SCRIPTTABSHEET_SETCONTENTMARGINRIGHT,
+ SCRIPTTABSHEET_SETCONTENTMARGINBOTTOM,
+ };
+ static XMLParamPair params[];
+ int myxuihandle;
+ PtrList<StringW> children_id;
+ void reloadChildren();
+ int type;
+ StringW wndtype;
+
+ int left_margin, right_margin, top_margin, bottom_margin;
+};
+
+
+// -----------------------------------------------------------------------
+// This defines the svc_xuiObject that exposes your wnd object
+
+extern const wchar_t ScriptTabSheetXuiObjectStr[];
+extern char ScriptTabSheetXuiSvcName[];
+class ScriptTabSheetXuiSvc : public XuiObjectSvc<ScriptTabSheet, ScriptTabSheetXuiObjectStr, ScriptTabSheetXuiSvcName> {};
+
+// -----------------------------------------------------------------------------------------------------
+class ScriptTabSheetController : public ScriptObjectControllerI {
+ public:
+
+ virtual const wchar_t *getClassName() { return L"TabSheet"; }
+ virtual const wchar_t *getAncestorClassName() { return L"GuiObject"; }
+ virtual ScriptObjectController *getAncestorController() { return WASABI_API_MAKI->maki_getController(guiObjectGuid); }
+ virtual int getNumFunctions();
+ virtual const function_descriptor_struct *getExportedFunctions();
+ virtual GUID getClassGuid() { return tabsheetGuid; }
+ virtual ScriptObject *instantiate();
+ virtual void destroy(ScriptObject *o);
+ virtual void *encapsulate(ScriptObject *o);
+ virtual void deencapsulate(void *o);
+
+ public:
+ static scriptVar tabsheet_getCurPage(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
+ static scriptVar tabsheet_setCurPage(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar a);
+ static scriptVar tabsheet_getNumPages(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
+ static scriptVar tabsheet_nextPage(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
+ static scriptVar tabsheet_previousPage(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
+
+ private:
+
+ static function_descriptor_struct exportedFunction[];
+};
+
+extern ScriptTabSheetController *tabsheetController;
+
+#endif
+