-/* xscreensaver, Copyright (c) 2006-2012 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 2006-2013 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
s.height = 999999;
s = [text sizeWithFont: font
constrainedToSize: s
- lineBreakMode: UILineBreakModeWordWrap];
+ lineBreakMode:NSLineBreakByWordWrapping];
// GAAAH. Add one more line, or the UIWebView is still scrollable!
// The text is sized right, but it lets you scroll it up anyway.
if ([active_text_field canResignFirstResponder])
[active_text_field resignFirstResponder];
NSString *pref_key = [pref_keys objectAtIndex: [sender tag]];
- double v = [sender value];
+
+ // Hacky API. See comment in InvertedSlider.m.
+ double v = ([sender isKindOfClass: [InvertedSlider class]]
+ ? [(InvertedSlider *) sender transformedValue]
+ : [sender value]);
+
if (v == (int) v)
[userDefaultsController setInteger:v forKey:pref_key];
else
if ([control isKindOfClass:[UISlider class]]) {
sel = @selector(sliderAction:);
- [(UISlider *) control setValue: dval];
+ // Hacky API. See comment in InvertedSlider.m.
+ if ([control isKindOfClass:[InvertedSlider class]])
+ [(InvertedSlider *) control setTransformedValue: dval];
+ else
+ [(UISlider *) control setValue: dval];
} else if ([control isKindOfClass:[UISwitch class]]) {
sel = @selector(switchAction:);
[(UISwitch *) control setOn: ((int) dval != 0)];
[lab setBackgroundColor:[UIColor clearColor]];
[lab setNumberOfLines:0]; // unlimited
// [lab setLineBreakMode:UILineBreakModeWordWrap];
- [lab setLineBreakMode:UILineBreakModeHeadTruncation];
+ [lab setLineBreakMode:NSLineBreakByTruncatingHead];
[lab setAutoresizingMask: (UIViewAutoresizingFlexibleWidth |
UIViewAutoresizingFlexibleHeight)];
# endif // USE_IPHONE
[lab setFrame:rect];
[self placeChild:lab on:parent];
# else // USE_IPHONE
- [lab setTextAlignment: UITextAlignmentRight];
+ [lab setTextAlignment: NSTextAlignmentRight];
[self placeChild:lab on:parent right:(label ? YES : NO)];
# endif // USE_IPHONE
for (NSArray *item in items) {
RadioButton *b = [[RadioButton alloc] initWithIndex:i
items:items];
- [b setLineBreakMode:UILineBreakModeHeadTruncation];
+ [b setLineBreakMode:NSLineBreakByTruncatingHead];
[b setFont:[NSFont boldSystemFontOfSize: FONT_SIZE]];
[self placeChild:b on:parent];
i++;
txt.font = [UIFont systemFontOfSize: FONT_SIZE];
txt.placeholder = @"";
txt.borderStyle = UITextBorderStyleRoundedRect;
- txt.textAlignment = UITextAlignmentRight;
+ txt.textAlignment = NSTextAlignmentRight;
txt.keyboardType = UIKeyboardTypeDefault; // Full kbd
txt.autocorrectionType = UITextAutocorrectionTypeNo;
txt.autocapitalizationType = UITextAutocapitalizationTypeNone;