dong83615 / siphon

Automatically exported from code.google.com/p/siphon
0 stars 0 forks source link

Numpad button displayed as pressed #292

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Press a numpad button in the PhoneViewController
2. Whithout releasing the numpad button tap the Contacts button in the toolbar
3. Release all pressed places
4. Tap the numpad icon in the toolbar

You will see the pressed numpad button on the numpad. 

SipHone 2.0.8 
iPhone OS 3.0

Solution by VoipSwitch
1.) File SiphonApplication.m

Add next line in the function applicationDidFinishLaunching
After code: tabBarController.selectedIndex = 2;
New line: tabBarController.delegate = self;

2.) File SiphonApplication.m
Add new Function 
- (void)tabBarController:(UITabBarController *)tabBarCtrl
didSelectViewController:(UIViewController *)viewController 
{
    if ( [tabBarCtrl selectedIndex] == 2 )
    {
        [phoneViewController resetNumPad];
    }
}

3.) File PhoneViewController.m
Add new function
- (void)resetNumPad 
{
    [_pad resetKeyPad];
}

4.) File PhonePad.m
Add new function 
- (void)resetKeyPad
{
    [NSObject cancelPreviousPerformRequestsWithTarget:self 
                                             selector:@selector(handleKeyPressAndHold:)
                                               object:nil];
    _downKey = 0;
    [self setNeedsDisplay];
}

Original issue reported on code.google.com by dzmitry....@gmail.com on 14 Sep 2009 at 8:36

Attachments:

GoogleCodeExporter commented 9 years ago
I fixed this issue, with a simplest and generic solution ;-)

Original comment by samuelv0...@gmail.com on 14 Sep 2009 at 9:03