summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
885ee23)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@631
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
m_yScrollLines = 0;
m_xScrollLinesPerPage = 0;
m_yScrollLinesPerPage = 0;
m_yScrollLines = 0;
m_xScrollLinesPerPage = 0;
m_yScrollLinesPerPage = 0;
+ m_scaleX = 1.0;
+ m_scaleY = 1.0;
}
bool wxScrolledWindow::Create(wxWindow *parent, wxWindowID id,
}
bool wxScrolledWindow::Create(wxWindow *parent, wxWindowID id,
m_yScrollLines = 0;
m_xScrollLinesPerPage = 0;
m_yScrollLinesPerPage = 0;
m_yScrollLines = 0;
m_xScrollLinesPerPage = 0;
m_yScrollLinesPerPage = 0;
+ m_scaleX = 1.0;
+ m_scaleY = 1.0;
return wxWindow::Create(parent, id, pos, size, style, name);
}
return wxWindow::Create(parent, id, pos, size, style, name);
}
void wxScrolledWindow::PrepareDC(wxDC& dc)
{
dc.SetDeviceOrigin(- m_xScrollPosition * m_xScrollPixelsPerLine, - m_yScrollPosition * m_yScrollPixelsPerLine);
void wxScrolledWindow::PrepareDC(wxDC& dc)
{
dc.SetDeviceOrigin(- m_xScrollPosition * m_xScrollPixelsPerLine, - m_yScrollPosition * m_yScrollPixelsPerLine);
+ dc.SetUserScale(m_scaleX, m_scaleY);
}
#if WXWIN_COMPATIBILITY
}
#if WXWIN_COMPATIBILITY
static inline void RemoveTrailingSeparator(wxString& str);
// returns TRUE if given registry key exists
static inline void RemoveTrailingSeparator(wxString& str);
// returns TRUE if given registry key exists
-static bool KeyExists(HKEY hRootKey, const char *szKey);
+static bool KeyExists(WXHKEY hRootKey, const char *szKey);
// combines value and key name (uses static buffer!)
static const char *GetFullName(const wxRegKey *pKey,
// combines value and key name (uses static buffer!)
static const char *GetFullName(const wxRegKey *pKey,
return (wxRegKey::StdKey)(int)hRootKey;
}
return (wxRegKey::StdKey)(int)hRootKey;
}
-wxRegKey::StdKey wxRegKey::GetStdKeyFromHkey(HKEY hkey)
+wxRegKey::StdKey wxRegKey::GetStdKeyFromHkey(WXHKEY hkey)
{
for ( size_t ui = 0; ui < nStdKeys; ui++ ) {
{
for ( size_t ui = 0; ui < nStdKeys; ui++ ) {
- if ( aStdKeys[ui].hkey == hkey )
+ if ( (int) aStdKeys[ui].hkey == (int) hkey )
wxRegKey::wxRegKey()
{
m_hKey = 0;
wxRegKey::wxRegKey()
{
m_hKey = 0;
- m_hRootKey = aStdKeys[HKCR].hkey;
+ m_hRootKey = (WXHKEY) aStdKeys[HKCR].hkey;
m_dwLastError = 0;
}
wxRegKey::wxRegKey(const wxString& strKey) : m_strKey(strKey)
{
m_dwLastError = 0;
}
wxRegKey::wxRegKey(const wxString& strKey) : m_strKey(strKey)
{
- m_hRootKey = aStdKeys[ExtractKeyName(m_strKey)].hkey;
+ m_hRootKey = (WXHKEY) aStdKeys[ExtractKeyName(m_strKey)].hkey;
m_hKey = NULL;
m_dwLastError = 0;
}
m_hKey = NULL;
m_dwLastError = 0;
}
wxRegKey::wxRegKey(StdKey keyParent, const wxString& strKey) : m_strKey(strKey)
{
RemoveTrailingSeparator(m_strKey);
wxRegKey::wxRegKey(StdKey keyParent, const wxString& strKey) : m_strKey(strKey)
{
RemoveTrailingSeparator(m_strKey);
- m_hRootKey = aStdKeys[keyParent].hkey;
+ m_hRootKey = (WXHKEY) aStdKeys[keyParent].hkey;
m_hKey = NULL;
m_dwLastError = 0;
}
m_hKey = NULL;
m_dwLastError = 0;
}
Close();
m_strKey = strKey;
Close();
m_strKey = strKey;
- m_hRootKey = aStdKeys[ExtractKeyName(m_strKey)].hkey;
+ m_hRootKey = (WXHKEY) aStdKeys[ExtractKeyName(m_strKey)].hkey;
}
// the name is relative to the parent key
}
// the name is relative to the parent key
m_strKey = strKey;
RemoveTrailingSeparator(m_strKey);
m_strKey = strKey;
RemoveTrailingSeparator(m_strKey);
- m_hRootKey = aStdKeys[keyParent].hkey;
+ m_hRootKey = (WXHKEY) aStdKeys[keyParent].hkey;
}
// the name is relative to the parent key
}
// the name is relative to the parent key
}
// hKey should be opened and will be closed in wxRegKey dtor
}
// hKey should be opened and will be closed in wxRegKey dtor
-void wxRegKey::SetHkey(HKEY hKey)
+void wxRegKey::SetHkey(WXHKEY hKey)
// returns the full name of the key (prefix is abbreviated if bShortPrefix)
wxString wxRegKey::GetName(bool bShortPrefix) const
{
// returns the full name of the key (prefix is abbreviated if bShortPrefix)
wxString wxRegKey::GetName(bool bShortPrefix) const
{
- StdKey key = GetStdKeyFromHkey(m_hRootKey);
+ StdKey key = GetStdKeyFromHkey((StdKey) m_hRootKey);
wxString str = bShortPrefix ? aStdKeys[key].szShortName
: aStdKeys[key].szName;
if ( !m_strKey.IsEmpty() )
wxString str = bShortPrefix ? aStdKeys[key].szShortName
: aStdKeys[key].szName;
if ( !m_strKey.IsEmpty() )
#ifdef __WIN32__
m_dwLastError = ::RegQueryInfoKey
(
#ifdef __WIN32__
m_dwLastError = ::RegQueryInfoKey
(
NULL, // class name
NULL, // (ptr to) size of class name buffer
RESERVED,
NULL, // class name
NULL, // (ptr to) size of class name buffer
RESERVED,
if ( IsOpened() )
return TRUE;
if ( IsOpened() )
return TRUE;
- m_dwLastError = RegOpenKey(m_hRootKey, m_strKey, &m_hKey);
+ HKEY tmpKey;
+ m_dwLastError = RegOpenKey((HKEY) m_hRootKey, m_strKey, &tmpKey);
if ( m_dwLastError != ERROR_SUCCESS ) {
wxLogSysError(m_dwLastError, _("can't open registry key '%s'"),
GetName().c_str());
return FALSE;
}
else
if ( m_dwLastError != ERROR_SUCCESS ) {
wxLogSysError(m_dwLastError, _("can't open registry key '%s'"),
GetName().c_str());
return FALSE;
}
else
+ {
+ m_hKey = (WXHKEY) tmpKey;
}
// creates key, failing if it exists and !bOkIfExists
}
// creates key, failing if it exists and !bOkIfExists
if ( IsOpened() )
return TRUE;
if ( IsOpened() )
return TRUE;
- m_dwLastError = RegCreateKey(m_hRootKey, m_strKey, &m_hKey);
+ HKEY tmpKey;
+ m_dwLastError = RegCreateKey((HKEY) m_hRootKey, m_strKey, &tmpKey);
if ( m_dwLastError != ERROR_SUCCESS ) {
wxLogSysError(m_dwLastError, _("can't create registry key '%s'"),
GetName().c_str());
return FALSE;
}
else
if ( m_dwLastError != ERROR_SUCCESS ) {
wxLogSysError(m_dwLastError, _("can't create registry key '%s'"),
GetName().c_str());
return FALSE;
}
else
+ {
+ m_hKey = (WXHKEY) tmpKey;
}
// close the key, it's not an error to call it when not opened
bool wxRegKey::Close()
{
if ( IsOpened() ) {
}
// close the key, it's not an error to call it when not opened
bool wxRegKey::Close()
{
if ( IsOpened() ) {
- m_dwLastError = RegCloseKey(m_hKey);
+ m_dwLastError = RegCloseKey((HKEY) m_hKey);
if ( m_dwLastError != ERROR_SUCCESS ) {
wxLogSysError(m_dwLastError, _("can't close registry key '%s'"),
GetName().c_str());
if ( m_dwLastError != ERROR_SUCCESS ) {
wxLogSysError(m_dwLastError, _("can't close registry key '%s'"),
GetName().c_str());
// now delete this key itself
Close();
// now delete this key itself
Close();
- m_dwLastError = RegDeleteKey(m_hRootKey, m_strKey);
+ m_dwLastError = RegDeleteKey((HKEY) m_hRootKey, m_strKey);
if ( m_dwLastError != ERROR_SUCCESS ) {
wxLogSysError(m_dwLastError, _("can't delete key '%s'"),
GetName().c_str());
if ( m_dwLastError != ERROR_SUCCESS ) {
wxLogSysError(m_dwLastError, _("can't delete key '%s'"),
GetName().c_str());
return FALSE;
#ifdef __WIN32__
return FALSE;
#ifdef __WIN32__
- m_dwLastError = RegDeleteValue(m_hKey, szValue);
+ m_dwLastError = RegDeleteValue((HKEY) m_hKey, szValue);
if ( m_dwLastError != ERROR_SUCCESS ) {
wxLogSysError(m_dwLastError, _("can't delete value '%s' from key '%s'"),
szValue, GetName().c_str());
if ( m_dwLastError != ERROR_SUCCESS ) {
wxLogSysError(m_dwLastError, _("can't delete value '%s' from key '%s'"),
szValue, GetName().c_str());
wxASSERT( IsEmpty(szValue) );
// just set the (default and unique) value of the key to ""
wxASSERT( IsEmpty(szValue) );
// just set the (default and unique) value of the key to ""
- m_dwLastError = RegSetValue(m_hKey, NULL, REG_SZ, "", RESERVED);
+ m_dwLastError = RegSetValue((HKEY) m_hKey, NULL, REG_SZ, "", RESERVED);
if ( m_dwLastError != ERROR_SUCCESS ) {
wxLogSysError(m_dwLastError, _("can't delete value of key '%s'"),
GetName().c_str());
if ( m_dwLastError != ERROR_SUCCESS ) {
wxLogSysError(m_dwLastError, _("can't delete value of key '%s'"),
GetName().c_str());
#ifdef __WIN32__
if ( CONST_CAST Open() ) {
#ifdef __WIN32__
if ( CONST_CAST Open() ) {
- return RegQueryValueEx(m_hKey, szValue, RESERVED,
+ return RegQueryValueEx((HKEY) m_hKey, szValue, RESERVED,
NULL, NULL, NULL) == ERROR_SUCCESS;
}
else
NULL, NULL, NULL) == ERROR_SUCCESS;
}
else
return Type_None;
DWORD dwType;
return Type_None;
DWORD dwType;
- m_dwLastError = RegQueryValueEx(m_hKey, szValue, RESERVED,
+ m_dwLastError = RegQueryValueEx((HKEY) m_hKey, szValue, RESERVED,
&dwType, NULL, NULL);
if ( m_dwLastError != ERROR_SUCCESS ) {
wxLogSysError(m_dwLastError, _("can't read value of key '%s'"),
&dwType, NULL, NULL);
if ( m_dwLastError != ERROR_SUCCESS ) {
wxLogSysError(m_dwLastError, _("can't read value of key '%s'"),
bool wxRegKey::SetValue(const char *szValue, long lValue)
{
if ( CONST_CAST Open() ) {
bool wxRegKey::SetValue(const char *szValue, long lValue)
{
if ( CONST_CAST Open() ) {
- m_dwLastError = RegSetValueEx(m_hKey, szValue, RESERVED, REG_DWORD,
+ m_dwLastError = RegSetValueEx((HKEY) m_hKey, szValue, RESERVED, REG_DWORD,
(RegString)&lValue, sizeof(lValue));
if ( m_dwLastError == ERROR_SUCCESS )
return TRUE;
(RegString)&lValue, sizeof(lValue));
if ( m_dwLastError == ERROR_SUCCESS )
return TRUE;
if ( CONST_CAST Open() ) {
DWORD dwType, dwSize = sizeof(DWORD);
RegString pBuf = (RegString)plValue;
if ( CONST_CAST Open() ) {
DWORD dwType, dwSize = sizeof(DWORD);
RegString pBuf = (RegString)plValue;
- m_dwLastError = RegQueryValueEx(m_hKey, szValue, RESERVED,
+ m_dwLastError = RegQueryValueEx((HKEY) m_hKey, szValue, RESERVED,
&dwType, pBuf, &dwSize);
if ( m_dwLastError != ERROR_SUCCESS ) {
wxLogSysError(m_dwLastError, _("can't read value of key '%s'"),
&dwType, pBuf, &dwSize);
if ( m_dwLastError != ERROR_SUCCESS ) {
wxLogSysError(m_dwLastError, _("can't read value of key '%s'"),
#ifdef __WIN32__
// first get the type and size of the data
DWORD dwType, dwSize;
#ifdef __WIN32__
// first get the type and size of the data
DWORD dwType, dwSize;
- m_dwLastError = RegQueryValueEx(m_hKey, szValue, RESERVED,
+ m_dwLastError = RegQueryValueEx((HKEY) m_hKey, szValue, RESERVED,
&dwType, NULL, &dwSize);
if ( m_dwLastError == ERROR_SUCCESS ) {
RegString pBuf = (RegString)strValue.GetWriteBuf(dwSize);
&dwType, NULL, &dwSize);
if ( m_dwLastError == ERROR_SUCCESS ) {
RegString pBuf = (RegString)strValue.GetWriteBuf(dwSize);
- m_dwLastError = RegQueryValueEx(m_hKey, szValue, RESERVED,
+ m_dwLastError = RegQueryValueEx((HKEY) m_hKey, szValue, RESERVED,
&dwType, pBuf, &dwSize);
strValue.UngetWriteBuf();
if ( m_dwLastError == ERROR_SUCCESS ) {
&dwType, pBuf, &dwSize);
strValue.UngetWriteBuf();
if ( m_dwLastError == ERROR_SUCCESS ) {
// named registry values don't exist in Win16
wxASSERT( IsEmpty(szValue) );
// named registry values don't exist in Win16
wxASSERT( IsEmpty(szValue) );
- m_dwLastError = RegQueryValue(m_hKey, 0, strValue.GetWriteBuf(256), &l);
+ m_dwLastError = RegQueryValue((HKEY) m_hKey, 0, strValue.GetWriteBuf(256), &l);
strValue.UngetWriteBuf();
if ( m_dwLastError == ERROR_SUCCESS )
return TRUE;
strValue.UngetWriteBuf();
if ( m_dwLastError == ERROR_SUCCESS )
return TRUE;
{
if ( CONST_CAST Open() ) {
#ifdef __WIN32__
{
if ( CONST_CAST Open() ) {
#ifdef __WIN32__
- m_dwLastError = RegSetValueEx(m_hKey, szValue, RESERVED, REG_SZ,
+ m_dwLastError = RegSetValueEx((HKEY) m_hKey, szValue, RESERVED, REG_SZ,
(RegString)strValue.c_str(),
strValue.Len() + 1);
if ( m_dwLastError == ERROR_SUCCESS )
(RegString)strValue.c_str(),
strValue.Len() + 1);
if ( m_dwLastError == ERROR_SUCCESS )
// named registry values don't exist in Win16
wxASSERT( IsEmpty(szValue) );
// named registry values don't exist in Win16
wxASSERT( IsEmpty(szValue) );
- m_dwLastError = RegSetValue(m_hKey, NULL, REG_SZ, strValue, NULL);
+ m_dwLastError = RegSetValue((HKEY) m_hKey, NULL, REG_SZ, strValue, NULL);
if ( m_dwLastError == ERROR_SUCCESS )
return TRUE;
#endif //WIN16/32
if ( m_dwLastError == ERROR_SUCCESS )
return TRUE;
#endif //WIN16/32
DWORD dwValueLen = WXSIZEOF(szValueName);
lIndex++;
DWORD dwValueLen = WXSIZEOF(szValueName);
lIndex++;
- m_dwLastError = RegEnumValue(m_hKey, lIndex,
+ m_dwLastError = RegEnumValue((HKEY) m_hKey, lIndex,
szValueName, &dwValueLen,
RESERVED,
NULL, // [out] type
szValueName, &dwValueLen,
RESERVED,
NULL, // [out] type
return FALSE;
char szKeyName[_MAX_PATH + 1];
return FALSE;
char szKeyName[_MAX_PATH + 1];
- m_dwLastError = RegEnumKey(m_hKey, lIndex++, szKeyName, WXSIZEOF(szKeyName));
+ m_dwLastError = RegEnumKey((HKEY) m_hKey, lIndex++, szKeyName, WXSIZEOF(szKeyName));
if ( m_dwLastError != ERROR_SUCCESS ) {
if ( m_dwLastError == ERROR_NO_MORE_ITEMS ) {
if ( m_dwLastError != ERROR_SUCCESS ) {
if ( m_dwLastError == ERROR_NO_MORE_ITEMS ) {
// ============================================================================
// implementation of global private functions
// ============================================================================
// ============================================================================
// implementation of global private functions
// ============================================================================
-bool KeyExists(HKEY hRootKey, const char *szKey)
+bool KeyExists(WXHKEY hRootKey, const char *szKey)
- if ( RegOpenKey(hRootKey, szKey, &hkeyDummy) == ERROR_SUCCESS ) {
+ if ( RegOpenKey( (HKEY) hRootKey, szKey, &hkeyDummy) == ERROR_SUCCESS ) {
RegCloseKey(hkeyDummy);
return TRUE;
}
RegCloseKey(hkeyDummy);
return TRUE;
}
// no such file type or no value
return FALSE;
}
// no such file type or no value
return FALSE;
}