mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-04-23 21:20:47 +00:00
* EOAdaptors/Postgres95/LoginPanel/Postgres95LoginPanel.m
(vfmaxf) Make static. Reformat. ([Postgres95LoginPanel dealloc]): Use DESTROY in favor of RELEASE. ([Postgres95LoginPanel init]): Minor reformatting and more tempRect usage. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@19136 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a5340cfeba
commit
8003cd4cb9
2 changed files with 49 additions and 32 deletions
|
@ -1,3 +1,12 @@
|
|||
2004-04-17 David Ayers <d.ayers@inode.at>
|
||||
|
||||
* EOAdaptors/Postgres95/LoginPanel/Postgres95LoginPanel.m
|
||||
(vfmaxf) Make static. Reformat.
|
||||
([Postgres95LoginPanel dealloc]): Use DESTROY in favor of
|
||||
RELEASE.
|
||||
([Postgres95LoginPanel init]): Minor reformatting and more
|
||||
tempRect usage.
|
||||
|
||||
2004-04-17 Matt Rice <ratmice@yahoo.com>
|
||||
|
||||
* EOAdaptors/Postgres95/LoginPanel/Postgres95LoginPanel.m
|
||||
|
|
|
@ -51,17 +51,24 @@ static NSString *someString = @"wwwwwwww";
|
|||
|
||||
|
||||
|
||||
float vfmaxf (int n,float aFloat,...)
|
||||
static float
|
||||
vfmaxf (int n, float aFloat, ...)
|
||||
{
|
||||
float champion=0.0;
|
||||
va_list list;
|
||||
|
||||
if (n == 0)
|
||||
return 0;
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
va_start(list,aFloat);
|
||||
champion = aFloat;
|
||||
|
||||
while (n > 1)
|
||||
{
|
||||
float contender;
|
||||
|
||||
contender = (float)va_arg(list,double);
|
||||
//printf("%f vs %f ",contender,champion);
|
||||
// fmaxf is c99 or i'd use it..
|
||||
|
@ -69,6 +76,7 @@ float vfmaxf (int n,float aFloat,...)
|
|||
//printf("champion: %f\n",champion);
|
||||
n--;
|
||||
}
|
||||
|
||||
va_end(list);
|
||||
return champion;
|
||||
}
|
||||
|
@ -76,11 +84,13 @@ float vfmaxf (int n,float aFloat,...)
|
|||
|
||||
|
||||
@implementation Postgres95LoginPanel : EOLoginPanel
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
RELEASE(_databases);
|
||||
RELEASE(_win);
|
||||
DESTROY(_databases);
|
||||
DESTROY(_win);
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
if ((self = [super init]))
|
||||
|
@ -235,6 +245,7 @@ float vfmaxf (int n,float aFloat,...)
|
|||
rect1.size.width,
|
||||
rect2.size.width,
|
||||
rect3.size.width);
|
||||
|
||||
maxLabelHeight = vfmaxf(3,
|
||||
rect1.size.height,
|
||||
rect2.size.height,
|
||||
|
@ -267,13 +278,11 @@ float vfmaxf (int n,float aFloat,...)
|
|||
[databaseLabel frame].size.height + (spacer*3);
|
||||
[userNameLabel setFrame:tempRect];
|
||||
|
||||
|
||||
|
||||
userNameField = [[NSTextField alloc] initWithFrame:
|
||||
NSMakeRect([userNameLabel frame].origin.x +
|
||||
[userNameLabel frame].size.width+spacer,
|
||||
[userNameLabel frame].origin.y,
|
||||
0,0)];
|
||||
tempRect = NSMakeRect([userNameLabel frame].origin.x +
|
||||
[userNameLabel frame].size.width+spacer,
|
||||
[userNameLabel frame].origin.y,
|
||||
0,0);
|
||||
userNameField = [[NSTextField alloc] initWithFrame: tempRect];
|
||||
|
||||
[userNameField setStringValue:someString];
|
||||
[userNameField sizeToFit];
|
||||
|
@ -282,26 +291,25 @@ float vfmaxf (int n,float aFloat,...)
|
|||
[userNameField setAction:@selector(ok:)];
|
||||
|
||||
maxFieldWidth=[userNameField frame].size.width;
|
||||
passwdField = [[NSSecureTextField alloc]
|
||||
initWithFrame:
|
||||
NSMakeRect([passwdLabel frame].origin.x +
|
||||
[passwdLabel frame].size.width + spacer,
|
||||
[passwdLabel frame].origin.y,
|
||||
0,
|
||||
0)];
|
||||
|
||||
tempRect = NSMakeRect([passwdLabel frame].origin.x +
|
||||
[passwdLabel frame].size.width + spacer,
|
||||
[passwdLabel frame].origin.y,
|
||||
0, 0);
|
||||
passwdField = [[NSSecureTextField alloc] initWithFrame: tempRect];
|
||||
|
||||
[passwdField setStringValue:someString];
|
||||
[passwdField sizeToFit];
|
||||
[passwdField setStringValue:@""];
|
||||
[passwdField setTarget:self];
|
||||
[passwdField setAction:@selector(self:)];
|
||||
|
||||
databaseField = [[NSTextField alloc]
|
||||
initWithFrame:
|
||||
NSMakeRect([databaseLabel frame].origin.x +
|
||||
[databaseLabel frame].size.width + spacer,
|
||||
[databaseLabel frame].origin.y,
|
||||
0,0)];
|
||||
|
||||
tempRect = NSMakeRect([databaseLabel frame].origin.x +
|
||||
[databaseLabel frame].size.width + spacer,
|
||||
[databaseLabel frame].origin.y,
|
||||
0,0);
|
||||
databaseField = [[NSTextField alloc] initWithFrame: tempRect];
|
||||
|
||||
[databaseField setStringValue:someString];
|
||||
[databaseField sizeToFit];
|
||||
[databaseField setStringValue:@""];
|
||||
|
@ -324,14 +332,13 @@ float vfmaxf (int n,float aFloat,...)
|
|||
(maxLabelHeight*3)+
|
||||
maxButtonHeight + (spacer *5)));
|
||||
|
||||
tempRect.origin.x = (screenSize.width/2) - (tempRect.size.width/2),
|
||||
tempRect.origin.y = (screenSize.height/2) - (tempRect.size.height/2),
|
||||
tempRect.origin.x = (screenSize.width/2) - (tempRect.size.width/2);
|
||||
tempRect.origin.y = (screenSize.height/2) - (tempRect.size.height/2);
|
||||
|
||||
_win = [[NSWindow alloc]
|
||||
initWithContentRect: tempRect
|
||||
styleMask: NSTitledWindowMask
|
||||
backing: NSBackingStoreRetained
|
||||
defer: YES];
|
||||
_win = [[NSWindow alloc] initWithContentRect: tempRect
|
||||
styleMask: NSTitledWindowMask
|
||||
backing: NSBackingStoreRetained
|
||||
defer: YES];
|
||||
[_win setTitle: windowTitle];
|
||||
[_win setDelegate:self];
|
||||
rect1 = [NSWindow contentRectForFrameRect:[_win frame]
|
||||
|
@ -395,6 +402,7 @@ float vfmaxf (int n,float aFloat,...)
|
|||
EOAdaptorChannel *channel;
|
||||
NSArray *databaseNames = nil;
|
||||
BOOL exceptionOccured = NO;
|
||||
|
||||
aMod = [EOModel new];
|
||||
[aMod setName: @"AvailableDatabases"];
|
||||
[aMod setAdaptorName: @"Postgres95"];
|
||||
|
|
Loading…
Reference in a new issue