Permalink
Browse files

previous / next buttons now navigate across QSections

  • Loading branch information...
1 parent fbf7a2f commit a0d9e5ce5844916dc41342785eb429d656b6f51b @bartvandendriessche committed Apr 25, 2012
Showing with 16 additions and 12 deletions.
  1. +16 −12 quickdialog/QEntryTableViewCell.m
@@ -258,25 +258,29 @@ - (BOOL)resignFirstResponder {
- (QEntryElement *)findPreviousElementToFocusOn {
QEntryElement *previousElement = nil;
- for (QElement * e in _entryElement.parentSection.elements){
- if (e == _entryElement) {
- return previousElement;
- }
- else if ([e isKindOfClass:[QEntryElement class]]){
- previousElement = (QEntryElement *)e;
+ for (QSection *section in _entryElement.parentSection.rootElement.sections) {
+ for (QElement * e in section.elements){
+ if (e == _entryElement) {
+ return previousElement;
+ }
+ else if ([e isKindOfClass:[QEntryElement class]]){
+ previousElement = (QEntryElement *)e;
+ }
}
}
return nil;
}
- (QEntryElement *)findNextElementToFocusOn {
BOOL foundSelf = NO;
- for (QElement * e in _entryElement.parentSection.elements){
- if (e == _entryElement) {
- foundSelf = YES;
- }
- else if (foundSelf && [e isKindOfClass:[QEntryElement class]]){
- return (QEntryElement *) e;
+ for (QSection *section in _entryElement.parentSection.rootElement.sections) {
+ for (QElement * e in section.elements){
+ if (e == _entryElement) {
+ foundSelf = YES;
+ }
+ else if (foundSelf && [e isKindOfClass:[QEntryElement class]]){
+ return (QEntryElement *) e;
+ }
}
}
return nil;

0 comments on commit a0d9e5c

Please sign in to comment.