]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/textctrl.cpp
Fixed VC++ compile error in mstream; formatted window.cpp.
[wxWidgets.git] / src / msw / textctrl.cpp
index 3def23203d57672f8715cd4dc3ab2e5303d82180..d9ae39cc62de128eb3546aebd0bb0583e2cea17e 100644 (file)
@@ -25,7 +25,7 @@
 #include "wx/settings.h"
 #endif
 
-#if USE_CLIPBOARD
+#if wxUSE_CLIPBOARD
 #include "wx/app.h"
 #include "wx/clipbrd.h"
 #endif
 
 #include <windows.h>
 #include <stdlib.h>
-#include "fstream.h"
+
+#if wxUSE_IOSTREAMH
+#include <fstream.h>
+#else
+#include <fstream>
+#  ifdef _MSC_VER
+      using namespace std;
+#  endif
+#endif
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -95,7 +103,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
 
   SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW));
 
-  SetForegroundColour(parent->GetDefaultForegroundColour()) ;
+  SetForegroundColour(parent->GetForegroundColour()) ;
 
   if ( id == -1 )
        m_windowId = (int)NewControlId();
@@ -254,7 +262,7 @@ void wxTextCtrl::AdoptAttributesFromHWND(void)
 void wxTextCtrl::SetupColours(void)
 {
   SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW));
-  SetForegroundColour(GetParent()->GetDefaultForegroundColour());
+  SetForegroundColour(GetParent()->GetForegroundColour());
 }
 
 wxString wxTextCtrl::GetValue(void) const
@@ -321,7 +329,7 @@ void wxTextCtrl::SetSize(int x, int y, int width, int height, int sizeFlags)
 
   wxGetCharSize(GetHWND(), &cx, &cy,GetFont());
 
-  float control_width, control_height, control_x, control_y;
+  int control_width, control_height, control_x, control_y;
 
   // If we're prepared to use the existing size, then...
   if (width == -1 && height == -1 && ((sizeFlags & wxSIZE_AUTO) != wxSIZE_AUTO))
@@ -333,17 +341,17 @@ void wxTextCtrl::SetSize(int x, int y, int width, int height, int sizeFlags)
   if (w1<=0)
     w1 = DEFAULT_ITEM_WIDTH;
 
-  control_x = (float)x1;
-  control_y = (float)y1;
-  control_width = (float)w1;
-  control_height = (float)h1;
+  control_x = x1;
+  control_y = y1;
+  control_width = w1;
+  control_height = h1;
 
   // Calculations may have made text size too small
   if (control_height <= 0)
-    control_height = (float)(int)(cy*EDIT_CONTROL_FACTOR) ;
+    control_height = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy);
 
   if (control_width <= 0)
-    control_width = (float)DEFAULT_ITEM_WIDTH;
+    control_width = DEFAULT_ITEM_WIDTH;
 
   MoveWindow((HWND) GetHWND(), (int)control_x, (int)control_y,
                               (int)control_width, (int)control_height, TRUE);
@@ -508,7 +516,8 @@ bool wxTextCtrl::LoadFile(const wxString& file)
 
   Clear();
 
-  ifstream input(WXSTRINGCAST file, ios::nocreate | ios::in);
+//  ifstream input(WXSTRINGCAST file, ios::nocreate | ios::in);
+  ifstream input(WXSTRINGCAST file, ios::in);
 
   if (!input.bad())
   {