mirror of
https://github.com/nednal12/APLOC2.git
synced 2026-01-22 08:18:08 +00:00
Most of the UI is working
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -11,11 +11,20 @@
|
||||
@interface ViewController : UIViewController
|
||||
{
|
||||
IBOutlet UISegmentedControl *segmentControl;
|
||||
UIViewController *viewController;
|
||||
IBOutlet UIStepper *stepperControl;
|
||||
IBOutlet UIButton *cricketButton;
|
||||
IBOutlet UIButton *butterflyButton;
|
||||
IBOutlet UIButton *antButton;
|
||||
IBOutlet UIButton *executeButton;
|
||||
IBOutlet UITextField *textBox;
|
||||
}
|
||||
|
||||
-(IBAction)onChange:(id)sender;
|
||||
|
||||
-(IBAction)onClick:(id)sender;
|
||||
|
||||
-(IBAction)onStepChange:(id)sender;
|
||||
|
||||
-(IBAction)onClassButtonClick:(id)sender;
|
||||
|
||||
@end
|
||||
|
||||
@@ -15,6 +15,76 @@
|
||||
|
||||
@implementation ViewController
|
||||
|
||||
-(IBAction)onClassButtonClick:(id)sender
|
||||
{
|
||||
UIButton *classButton = (UIButton*)sender;
|
||||
if (classButton.tag == 0)
|
||||
{
|
||||
textBox.text = @"Cricket";
|
||||
stepperControl.enabled = TRUE;
|
||||
classButton.enabled = FALSE;
|
||||
antButton.enabled = TRUE;
|
||||
butterflyButton.enabled = TRUE;
|
||||
stepperControl.value = 0;
|
||||
}
|
||||
else if (classButton.tag == 1)
|
||||
{
|
||||
textBox.text = @"Butterfly";
|
||||
stepperControl.enabled = TRUE;
|
||||
classButton.enabled = FALSE;
|
||||
antButton.enabled = TRUE;
|
||||
cricketButton.enabled = TRUE;
|
||||
stepperControl.value = 0;
|
||||
|
||||
}
|
||||
else if (classButton.tag == 2)
|
||||
{
|
||||
textBox.text = @"Ant";
|
||||
stepperControl.enabled = TRUE;
|
||||
classButton.enabled = FALSE;
|
||||
cricketButton.enabled = TRUE;
|
||||
butterflyButton.enabled = TRUE;
|
||||
stepperControl.value = 0;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-(IBAction)onStepChange:(id)sender
|
||||
{
|
||||
UIStepper *stepControl = (UIStepper*) sender;
|
||||
if (stepControl != nil)
|
||||
{
|
||||
int currentValue = stepControl.value;
|
||||
|
||||
if (currentValue == 1)
|
||||
{
|
||||
if (cricketButton.enabled == FALSE)
|
||||
{
|
||||
textBox.text = @"Cricket";
|
||||
}
|
||||
else if (butterflyButton.enabled == FALSE)
|
||||
{
|
||||
textBox.text = @"Butterfly";
|
||||
}
|
||||
else textBox.text = @"Ant";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (cricketButton.enabled == FALSE)
|
||||
{
|
||||
textBox.text = [NSString stringWithFormat:@"%d Crickets", currentValue];
|
||||
}
|
||||
else if (butterflyButton.enabled == FALSE)
|
||||
{
|
||||
textBox.text = [NSString stringWithFormat:@"%d Butterflies", currentValue];
|
||||
}
|
||||
else textBox.text = [NSString stringWithFormat:@"%d Ants", currentValue];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-(IBAction)onClick:(id)sender
|
||||
{
|
||||
ViewController2 *secondView = [[ViewController2 alloc] initWithNibName:@"ViewController2" bundle:nil];
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user