select siblings and initial tree scrolling
This commit is contained in:
@@ -5,7 +5,18 @@
|
||||
#include "person.h"
|
||||
|
||||
using person_id = U32;
|
||||
enum RelType: U8;
|
||||
enum RelType : U8
|
||||
{
|
||||
None = 0,
|
||||
Parent,
|
||||
Child,
|
||||
Sibling,
|
||||
HalfSibling,
|
||||
Spouse,
|
||||
ExSpouse,
|
||||
|
||||
Other
|
||||
};
|
||||
|
||||
struct Relation
|
||||
{
|
||||
@@ -37,9 +48,10 @@ public:
|
||||
person_id findOldestAncestor(person_id id, bool sex = 0) const;//
|
||||
//oldest common ancestor ID, a person is considerd an ancestor of himself
|
||||
person_id findCommonAncestor(person_id firstId, person_id secondId) const;
|
||||
person_id findRelation(person_id first, person_id second) const;
|
||||
RelType findRelation(person_id first, person_id second) const;
|
||||
person_id findParent(person_id child, bool isParentMale) const;
|
||||
person_id findSpouse(person_id person) const;
|
||||
std::vector<person_id> findChildren(person_id person) const;
|
||||
|
||||
void saveTree()const;//
|
||||
bool loadTree();
|
||||
@@ -74,6 +86,8 @@ private:
|
||||
void selectUp();
|
||||
void selectRight();
|
||||
|
||||
void selectLeftSibSpouse(person_id person);
|
||||
void selectRightSib(person_id person);
|
||||
|
||||
std::string treeName = "Unnamed";
|
||||
unsigned numPeople = 0;
|
||||
@@ -82,21 +96,10 @@ private:
|
||||
|
||||
person_id focused_ = 0; /* the tree was draw based on this person */
|
||||
person_id selected_ = 0;
|
||||
U16 offset_ = 0; /* offset of the tree */
|
||||
I16 offsetX_ = 0; /* offset of the tree in relation to the screen*/
|
||||
I16 offsetY_ = 0;
|
||||
U8 dist_between_ = 1; /* distance between people */
|
||||
U8 spouse_dist_ = 0; /* distance between spouses */
|
||||
//Search, ect.
|
||||
};
|
||||
|
||||
enum RelType : U8
|
||||
{
|
||||
None = 0,
|
||||
Parent,
|
||||
Child,
|
||||
Sibling,
|
||||
HalfSibling,
|
||||
Spouse,
|
||||
ExSpouse,
|
||||
|
||||
Other
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user