summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXButton.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-10-23 07:39:03 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-10-23 07:39:03 (GMT)
commitc38626d1adc195c2d87e1d6c16fa61ab473683a5 (patch)
treeb315a885a77d6fd35d85e99ec0823db2f294f6cd /macosx/tkMacOSXButton.c
parente053bd03f34f27fd2871e8275d281fb1277f98e8 (diff)
downloadtk-c38626d1adc195c2d87e1d6c16fa61ab473683a5.zip
tk-c38626d1adc195c2d87e1d6c16fa61ab473683a5.tar.gz
tk-c38626d1adc195c2d87e1d6c16fa61ab473683a5.tar.bz2
Backport of ::tk::mac::useCompatibilityMetrics handling and scrollbar metrics handling from trunk
Diffstat (limited to 'macosx/tkMacOSXButton.c')
-rw-r--r--macosx/tkMacOSXButton.c44
1 files changed, 16 insertions, 28 deletions
diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c
index 61382c4..f912b81 100644
--- a/macosx/tkMacOSXButton.c
+++ b/macosx/tkMacOSXButton.c
@@ -10,8 +10,6 @@
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * RCS: @(#) $Id$
*/
#include "tkMacOSXPrivate.h"
@@ -81,6 +79,8 @@ static void ComputeUnixButtonGeometry(TkButton *butPtr);
Tk_ClassProcs tkpButtonProcs = {
sizeof(Tk_ClassProcs), /* size */
TkButtonWorldChanged, /* worldChangedProc */
+ NULL, /* createProc */
+ NULL /* modalProc */
};
@@ -245,27 +245,16 @@ TkpComputeButtonGeometry(
*/
void
-TkpButtonSetDefaults(
- Tk_OptionSpec *specPtr) /* Points to an array of option specs,
- * terminated by one with type
- * TK_OPTION_END. */
+TkpButtonSetDefaults()
{
#if TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS
if (!tkMacOSXUseCompatibilityMetrics) {
- while (specPtr->type != TK_CONFIG_END) {
- switch (specPtr->internalOffset) {
- case Tk_Offset(TkButton, highlightWidth):
- specPtr->defValue = DEF_BUTTON_HIGHLIGHT_WIDTH_NOCM;
- break;
- case Tk_Offset(TkButton, padX):
- specPtr->defValue = DEF_BUTTON_PADX_NOCM;
- break;
- case Tk_Offset(TkButton, padY):
- specPtr->defValue = DEF_BUTTON_PADY_NOCM;
- break;
- }
- specPtr++;
- }
+ strcpy(tkDefButtonHighlightWidth, DEF_BUTTON_HIGHLIGHT_WIDTH_NOCM);
+ strcpy(tkDefLabelHighlightWidth, DEF_BUTTON_HIGHLIGHT_WIDTH_NOCM);
+ strcpy(tkDefButtonPadx, DEF_BUTTON_PADX_NOCM);
+ strcpy(tkDefLabelPadx, DEF_BUTTON_PADX_NOCM);
+ strcpy(tkDefButtonPady, DEF_BUTTON_PADY_NOCM);
+ strcpy(tkDefLabelPady, DEF_BUTTON_PADY_NOCM);
}
#endif
}
@@ -588,12 +577,12 @@ ComputeNativeButtonGeometry(
}
// if font is too tall, we can't use the fixed-height rounded bezel
- if (!haveImage && haveText && style == NSRoundedBezelStyle) {
- Tk_FontMetrics fm;
- Tk_GetFontMetrics(butPtr->tkfont, &fm);
- if (fm.linespace > 18) {
- [button setBezelStyle:(style = NSRegularSquareBezelStyle)];
- }
+ if (!haveImage && haveText && style == NSRoundedBezelStyle) {
+ Tk_FontMetrics fm;
+ Tk_GetFontMetrics(butPtr->tkfont, &fm);
+ if (fm.linespace > 18) {
+ [button setBezelStyle:(style = NSRegularSquareBezelStyle)];
+ }
}
bounds.size = [cell cellSize];
@@ -673,7 +662,6 @@ ComputeNativeButtonGeometry(
#endif
}
-
#pragma mark -
#pragma mark Unix Buttons:
@@ -1183,7 +1171,7 @@ ComputeUnixButtonGeometry(
/*
* Local Variables:
- * mode: c
+ * mode: objc
* c-basic-offset: 4
* fill-column: 79
* coding: utf-8