Permalink
Browse files

Merge pull request #160 from bartvandendriessche/next_previous_should…

…_jump_across_sections

previous / next buttons now navigate across QSections
  • Loading branch information...
2 parents fbf7a2f + a0d9e5c commit 805ef2a568517b5f096a9c8ecbd41c1c3e982f77 @escoz escoz 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 805ef2a

Please sign in to comment.