OS X: improve drawing of grayed-out lists, bitmap-labelled radio buttons, and non-bordered tab panels

svn: r5976
This commit is contained in:
Matthew Flatt 2007-04-19 01:45:01 +00:00
parent 59451c941c
commit 1e9ceda1a2
8 changed files with 33 additions and 3 deletions

View File

@ -204,6 +204,11 @@ ALIST_API void ALActivate(Boolean isActive, ALHandle hAL)
} }
} // ALActivate } // ALActivate
ALIST_API int ALIsActive(ALHandle hAL)
{
return BTST((*hAL)->flags, alFActive) ? 1 : 0;
}
ALIST_API ControlPartCode ALSetFocus(ControlPartCode focusPart, ALHandle hAL) ALIST_API ControlPartCode ALSetFocus(ControlPartCode focusPart, ALHandle hAL)
{ ControlPartCode result; { ControlPartCode result;
Boolean oldFocus; Boolean oldFocus;

View File

@ -635,7 +635,8 @@ ALIST_API void ALSetSelectAll(Boolean redrawIfChange, ALReference hAL);
ALIST_API OSErr ALGetInfo(ALSelector selector, void *info, ALReference hAL); ALIST_API OSErr ALGetInfo(ALSelector selector, void *info, ALReference hAL);
ALIST_API OSErr ALSetInfo(ALSelector selector, const void *info, ALReference hAL); ALIST_API OSErr ALSetInfo(ALSelector selector, const void *info, ALReference hAL);
ALIST_API short ALFeatureFlag(unsigned long feature, short action, ALReference hAL); ALIST_API short ALFeatureFlag(unsigned long feature, short action, ALReference hAL);
ALIST_API void ALActivate(Boolean isActive, ALReference hAL); ALIST_API void ALActivate(Boolean isActive, ALReference hAL);
ALIST_API int ALIsActive(ALReference hAL);
ALIST_API ControlPartCode ALSetFocus(ControlPartCode focusPart, ALReference hAL); ALIST_API ControlPartCode ALSetFocus(ControlPartCode focusPart, ALReference hAL);
ALIST_API ControlPartCode ALPartFocused(ALReference hAL); ALIST_API ControlPartCode ALPartFocused(ALReference hAL);

View File

@ -179,6 +179,9 @@ class wxCanvas: public wxbCanvas
wxColor *GetCanvasBackground(); wxColor *GetCanvasBackground();
Bool SetAsControl(); Bool SetAsControl();
protected:
void ChangeToGray(Bool Gray);
}; };
#endif // IN_CPROTO #endif // IN_CPROTO

View File

@ -105,6 +105,9 @@ class wxRadioButton: public wxItem
virtual void OnSetFocus(); virtual void OnSetFocus();
virtual void OnKillFocus(); virtual void OnKillFocus();
protected:
void ChangeToGray(Bool Gray);
}; };
#endif // IN_CPROTO #endif // IN_CPROTO

View File

@ -710,6 +710,13 @@ void wxCanvas::ShowAsActive(Bool flag)
/* Do nothing. */ /* Do nothing. */
} }
void wxCanvas::ChangeToGray(Bool gray)
{
if (cStyle & wxAS_CONTROL)
Refresh();
wxbCanvas::ChangeToGray(gray);
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void wxCanvas::ClientToLogical(int* x, int* y) // mac platform only; testing void wxCanvas::ClientToLogical(int* x, int* y) // mac platform only; testing
{ // Transform point from client c.s. to logical c.s. (virtual canvas, scrolling) { // Transform point from client c.s. to logical c.s. (virtual canvas, scrolling)

View File

@ -641,7 +641,6 @@ static char *GetNthPath(NavReplyRecord *reply, int index)
return wxFSRefToPath(fsref); return wxFSRefToPath(fsref);
} }
static CFStringRef clientName = CFSTR("MrEd");
static NavEventUPP extProc = NewNavEventUPP((NavEventProcPtr)ExtensionCallback); static NavEventUPP extProc = NewNavEventUPP((NavEventProcPtr)ExtensionCallback);
char *wxFileSelector(char *message, char *default_path, char *wxFileSelector(char *message, char *default_path,

View File

@ -80,7 +80,12 @@ static void MyDrawCell(ALData cellData, ALCellPtr cell, const Rect *cellRect, AL
::GetFontInfo(&fontInfo); ::GetFontInfo(&fontInfo);
MoveTo(cellRect->left, fontInfo.ascent + cellRect->top); MoveTo(cellRect->left, fontInfo.ascent + cellRect->top);
ForeColor(blackColor); if (!ALIsActive(hAL)) {
RGBColor c;
c.red = c.green = c.blue = 0x7FFF;
RGBForeColor(&c);
} else
ForeColor(blackColor);
CopyPascalStringToC(*(StringHandle)cellData, wxBuffer); CopyPascalStringToC(*(StringHandle)cellData, wxBuffer);
TextMode(srcOr); TextMode(srcOr);
wxDrawUnicodeText(wxBuffer, 0, -1, 0); wxDrawUnicodeText(wxBuffer, 0, -1, 0);

View File

@ -283,6 +283,13 @@ void wxRadioButton::Paint(void)
} }
} }
void wxRadioButton::ChangeToGray(Bool gray)
{
if (cPaintControl)
Refresh();
wxItem::ChangeToGray(gray);
}
void wxRadioButton::Highlight(Bool on) void wxRadioButton::Highlight(Bool on)
{ {
if (on) if (on)