]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/msw/private.h
remove unfinished impl
[wxWidgets.git] / include / wx / msw / private.h
index 31954e87c2a8c38b7e2488fa6784fc4c5f796dae..b1ee23b549800975ad124f0cc320b240d409710c 100644 (file)
@@ -46,6 +46,11 @@ static const double twips2mm = (1/(METRIC_CONVERSION_CONSTANT*1440));
 static const double mm2pt = (METRIC_CONVERSION_CONSTANT*72);
 static const double pt2mm = (1/(METRIC_CONVERSION_CONSTANT*72));
 
+// 260 was taken from windef.h
+#ifndef MAX_PATH
+    #define MAX_PATH  260
+#endif
+
 // ---------------------------------------------------------------------------
 // standard icons from the resources
 // ---------------------------------------------------------------------------
@@ -138,11 +143,11 @@ WXDLLEXPORT_DATA(extern HFONT) wxSTATUS_LINE_FONT;
 #define STATIC_FLAGS     (SS_LEFT|WS_CHILD|WS_VISIBLE)
 #define CHECK_CLASS      wxT("BUTTON")
 #define CHECK_FLAGS      (BS_AUTOCHECKBOX|WS_TABSTOP|WS_CHILD)
-#define CHECK_IS_FAFA   FALSE
+#define CHECK_IS_FAFA    FALSE
 #define RADIO_CLASS      wxT("BUTTON")
 #define RADIO_FLAGS      (BS_AUTORADIOBUTTON|WS_CHILD|WS_VISIBLE)
 #define RADIO_SIZE       20
-#define RADIO_IS_FAFA   FALSE
+#define RADIO_IS_FAFA    FALSE
 #define PURE_WINDOWS
 #define GROUP_CLASS      wxT("BUTTON")
 #define GROUP_FLAGS      (BS_GROUPBOX|WS_CHILD|WS_VISIBLE)
@@ -348,6 +353,22 @@ private:
     DECLARE_NO_COPY_CLASS(ScreenHDC)
 };
 
+// the same as ScreenHDC but for window DCs
+class WindowHDC
+{
+public:
+    WindowHDC(HWND hwnd) { m_hdc = ::GetDC(m_hwnd = hwnd); }
+   ~WindowHDC() { ::ReleaseDC(m_hwnd, m_hdc); }
+
+    operator HDC() const { return m_hdc; }
+
+private:
+   HWND m_hwnd;
+   HDC m_hdc;
+
+   DECLARE_NO_COPY_CLASS(WindowHDC)
+};
+
 // the same as ScreenHDC but for memory DCs: creates the HDC compatible with
 // the given one (screen by default) in ctor and destroys it in dtor
 class MemoryHDC
@@ -487,13 +508,30 @@ extern "C"
 
 WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
 
+// return the full name of the program file
+inline wxString wxGetFullModuleName()
+{
+    wxString fullname;
+    if ( !::GetModuleFileName
+            (
+                (HMODULE)wxGetInstance(),
+                wxStringBuffer(fullname, MAX_PATH),
+                MAX_PATH
+            ) )
+    {
+        wxLogLastError(_T("GetModuleFileName"));
+    }
+
+    return fullname;
+}
+
 #if wxUSE_GUI
 
 // cursor stuff
 extern HCURSOR wxGetCurrentBusyCursor();    // from msw/utils.cpp
 extern const wxCursor *wxGetGlobalCursor(); // from msw/cursor.cpp
 
-WXDLLEXPORT void wxGetCharSize(WXHWND wnd, int *x, int *y, const wxFont *the_font);
+WXDLLEXPORT void wxGetCharSize(WXHWND wnd, int *x, int *y, const wxFontthe_font);
 WXDLLEXPORT void wxFillLogFont(LOGFONT *logFont, const wxFont *font);
 WXDLLEXPORT wxFont wxCreateFontFromLogFont(const LOGFONT *logFont);
 WXDLLEXPORT wxFontEncoding wxGetFontEncFromCharSet(int charset);