[loading window] Indeterminate for Mac OS X.
Is there a way to use performSelector withBool?
This commit is contained in:
@@ -11,6 +11,7 @@ public:
|
|||||||
void SetText( RString str );
|
void SetText( RString str );
|
||||||
void SetProgress( const int progress );
|
void SetProgress( const int progress );
|
||||||
void SetTotalWork( const int totalWork );
|
void SetTotalWork( const int totalWork );
|
||||||
|
void SetIndeterminate( bool indeterminate );
|
||||||
};
|
};
|
||||||
#define USE_LOADING_WINDOW_MACOSX
|
#define USE_LOADING_WINDOW_MACOSX
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
- (void) setupWindow:(NSImage *)image;
|
- (void) setupWindow:(NSImage *)image;
|
||||||
- (void) setProgress:(NSNumber *)progress;
|
- (void) setProgress:(NSNumber *)progress;
|
||||||
- (void) setTotalWork:(NSNumber *)totalWork;
|
- (void) setTotalWork:(NSNumber *)totalWork;
|
||||||
|
- (void) setIndeterminate:(NSNumber *)indeterminate;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation LoadingWindowHelper
|
@implementation LoadingWindowHelper
|
||||||
@@ -96,6 +97,11 @@
|
|||||||
[m_ProgressIndicator setMaxValue:[totalWork doubleValue]];
|
[m_ProgressIndicator setMaxValue:[totalWork doubleValue]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) setIndeterminate:(NSNumber *)indeterminate
|
||||||
|
{
|
||||||
|
[m_ProgressIndicator setIndeterminate:(indeterminate > 0 ? YES : NO)];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
static LoadingWindowHelper *g_Helper = nil;
|
static LoadingWindowHelper *g_Helper = nil;
|
||||||
@@ -160,6 +166,12 @@ void LoadingWindow_MacOSX::SetTotalWork( const int totalWork )
|
|||||||
[g_Helper performSelectorOnMainThread:@selector(setTotalWork:) withObject:[NSNumber numberWithDouble:(double)totalWork] waitUntilDone:NO];
|
[g_Helper performSelectorOnMainThread:@selector(setTotalWork:) withObject:[NSNumber numberWithDouble:(double)totalWork] waitUntilDone:NO];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LoadingWindow_MacOSX::SetIndeterminate( bool indeterminate )
|
||||||
|
{
|
||||||
|
double tmp = indeterminate ? 1 : 0;
|
||||||
|
[g_Helper performSelectorOnMainThread:@selector(setIndeterminate:) withObject:[NSNumber numberWithDouble:tmp] waitUntilDone:NO];
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) 2003-2006, 2008 Steve Checkoway
|
* (c) 2003-2006, 2008 Steve Checkoway
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
Reference in New Issue
Block a user