]> cygwin.com Git - cygwin-apps/setup.git/blobdiff - proppage.h
Use solver to check for problems and produce a list of package transactions
[cygwin-apps/setup.git] / proppage.h
index 29f3b15127d810268a93e78e70eb005110f976bc..9424ffc21a4a05ac9de0e3343c8ec633c61d6ad3 100644 (file)
@@ -1,8 +1,5 @@
-#ifndef CINSTALL_PROPPAGE_H
-#define CINSTALL_PROPPAGE_H
-
 /*
- * Copyright (c) 2001, Gary R. Van Sickle.
+ * Copyright (c) 2001, 2002, 2003 Gary R. Van Sickle.
  *
  *     This program is free software; you can redistribute it and/or modify
  *     it under the terms of the GNU General Public License as published by
  *
  */
 
+#ifndef SETUP_PROPPAGE_H
+#define SETUP_PROPPAGE_H
+
 // This is the header for the PropertyPage class.  It works closely with the
 // PropSheet class to implement a single page of the property sheet.
 
 
-#include <windows.h>
+#include <map>
+#include "win32.h"
 #include <prsht.h>
 
 #include "window.h"
+#include "ControlAdjuster.h"
 
 class PropSheet;
 
@@ -39,16 +41,49 @@ class PropertyPage:public Window
 
   // For setting the back/finish buttons properly.
   bool IsFirst, IsLast;
-
-  static BOOL CALLBACK FirstDialogProcReflector (HWND hwnd, UINT message,
+  
+  static INT_PTR CALLBACK FirstDialogProcReflector (HWND hwnd, UINT message,
                                                 WPARAM wParam,
                                                 LPARAM lParam);
-  static BOOL CALLBACK DialogProcReflector (HWND hwnd, UINT message,
+  static INT_PTR CALLBACK DialogProcReflector (HWND hwnd, UINT message,
                                            WPARAM wParam, LPARAM lParam);
-
+  void setTitleFont ();
+
+  // this is an internal structure that is used to store information
+  // about static text controls in the dialog that have been turned
+  // into clickable URLs
+  typedef struct
+    {
+      // the URL to load when clicked
+      std::string url;             
+
+      // location of the control's original winproc that we are subclassing
+      WNDPROC origWinProc;
+
+      // font handle; note: it's our responsibility to DeleteObject() this
+      HFONT font;
+      
+      // handle to the brush we return in response to WM_CTLCOLORSTATIC
+      HBRUSH brush;
+    } ClickableURL;
+    
+  // the list of controls that we have modified to be clickable is
+  // stored in the following which maps the ID to the above data
+  static std::map <int, ClickableURL> urls;
+    
+  // subclass the static control with this winproc
+  static LRESULT CALLBACK urlWinProc (HWND hwnd, UINT uMsg, WPARAM wParam,
+              LPARAM lParam);
+  
 protected:
-    virtual BOOL CALLBACK DialogProc (UINT message, WPARAM wParam,
-                                     LPARAM lParam);
+    SizeProcessor sizeProcessor;
+  
+    virtual INT_PTR CALLBACK DialogProc (UINT message, WPARAM wParam,
+                                        LPARAM lParam);
+    virtual INT_PTR CALLBACK OnMouseWheel (UINT message, WPARAM wParam,
+                                          LPARAM lParam);
+    virtual INT_PTR CALLBACK OnTimerMessage (UINT message, WPARAM wParam,
+                                            LPARAM lparam);
 
 public:
     PropertyPage ();
@@ -92,9 +127,19 @@ public:
   virtual void OnActivate ()
   {
   };
+  virtual bool wantsActivation () const
+  {
+    return true;
+  };
   virtual void OnDeactivate ()
   {
   };
+
+  // Overload these to perform special processing when the user hits
+  // "Next" or "Back". Return:
+  // 0 == Go to next/previous page in sequence.
+  // -1 == Prevent wizard from changing page.
+  // Resource ID == go to a specific page specified by the resource ID.
   virtual long OnNext ()
   {
     return 0;
@@ -103,15 +148,22 @@ public:
   {
     return 0;
   };
+
   virtual bool OnFinish ()
   {
     return true;
   };
+  virtual long OnUnattended ()
+  {
+    return -2;
+  };
 
   PropSheet *GetOwner () const
   {
     return OurSheet;
   };
+  
+  void makeClickable (int id, std::string link);
 };
 
-#endif // CINSTALL_PROPPAGE_H
+#endif /* SETUP_PROPPAGE_H */
This page took 0.027023 seconds and 5 git commands to generate.