aboutsummaryrefslogtreecommitdiff
path: root/Src/Wasabi/api/skin/widgets/pathpicker.h
diff options
context:
space:
mode:
authorJean-Francois Mauguit <jfmauguit@mac.com>2024-09-24 09:03:25 -0400
committerGitHub <noreply@github.com>2024-09-24 09:03:25 -0400
commitbab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Wasabi/api/skin/widgets/pathpicker.h
parent4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff)
parent20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff)
downloadwinamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/Wasabi/api/skin/widgets/pathpicker.h')
-rw-r--r--Src/Wasabi/api/skin/widgets/pathpicker.h183
1 files changed, 183 insertions, 0 deletions
diff --git a/Src/Wasabi/api/skin/widgets/pathpicker.h b/Src/Wasabi/api/skin/widgets/pathpicker.h
new file mode 100644
index 00000000..37b9127b
--- /dev/null
+++ b/Src/Wasabi/api/skin/widgets/pathpicker.h
@@ -0,0 +1,183 @@
+#ifndef __PATHPICKER_H
+#define __PATHPICKER_H
+
+#include <api/wnd/wndclass/guiobjwnd.h>
+#include <api/script/objects/c_script/h_guiobject.h>
+#include <api/script/objects/c_script/h_button.h>
+
+#define PATHPICKER_PARENT GuiObjectWnd
+
+class PPClicksCallback;
+extern int __id;
+
+
+/**
+ Class
+
+ @short
+ @author Nullsoft
+ @ver 1.0
+ @see
+*/
+class PathPicker : public PATHPICKER_PARENT {
+
+ public:
+
+
+ /**
+ Method
+
+ @see
+ @ret
+ @param
+ */
+ PathPicker();
+
+
+ virtual ~PathPicker();
+
+
+ /**
+ Method
+
+ @see
+ @ret
+ @param
+ */
+ virtual int onInit();
+
+
+ /**
+ Method
+
+ @see
+ @ret
+ @param
+ */
+ void clickCallback();
+
+
+#ifdef WASABI_COMPILE_CONFIG
+ /**
+ Method
+
+ @see
+ @ret
+ @param
+ */
+ virtual int onReloadConfig();
+#endif
+
+ /**
+ Method
+
+ @see
+ @ret
+ @param
+ */
+ virtual void abstract_onNewContent();
+ void setPath(const wchar_t *newpath);
+ const wchar_t *getPath() { return curpath; }
+
+
+ /**
+ Method
+
+ @see
+ @ret
+ @param
+ */
+ virtual void onPathChanged(const wchar_t *newpath);
+
+
+ /**
+ Method
+
+ @see
+ @ret
+ @param
+ */
+ virtual void setDefault();
+
+ private:
+
+ /**
+ Method
+
+ @see
+ @ret
+ @param
+ */
+ void updatePathInControl();
+
+ /**
+ Method
+
+ @see
+ @ret
+ @param
+ */
+#ifdef WASABI_COMPILE_CONFIG
+ void updatePathFromConfig();
+#endif
+ /**
+ Method
+
+ @see
+ @ret
+ @param
+ */
+ void trapControls();
+
+ PPClicksCallback *clicks_button;
+ StringW curpath;
+ int disable_cfg_event;
+};
+
+
+/**
+ Class
+
+ @short
+ @author Nullsoft
+ @ver 1.0
+ @see
+*/
+class PPClicksCallback : public H_GuiObject {
+ public:
+
+ /**
+ Method
+
+ @see
+ @ret
+ @param
+ */
+ PPClicksCallback(ScriptObject *trap, PathPicker *_callback) :
+
+ /**
+ Method
+
+ @see
+ @ret
+ @param
+ */
+ callback(_callback), H_GuiObject(trap) {
+ }
+
+
+ /**
+ Method
+
+ @see
+ @ret
+ @param
+ */
+ virtual void hook_onLeftButtonDown(int x, int y) {
+ callback->clickCallback();
+ }
+ private:
+ PathPicker *callback;
+};
+
+#endif