1 /* 2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef ABSTRACT_GENERAL_PAGE_H 6 #define ABSTRACT_GENERAL_PAGE_H 7 8 #include <GroupView.h> 9 #include <StringView.h> 10 11 12 class BGridView; 13 14 15 class LabelView : public BStringView { 16 public: 17 LabelView(const char* text) 18 : 19 BStringView(NULL, text) 20 { 21 SetExplicitAlignment(BAlignment(B_ALIGN_RIGHT, 22 B_ALIGN_VERTICAL_CENTER)); 23 } 24 }; 25 26 27 class TextDataView : public BStringView { 28 public: 29 TextDataView() 30 : 31 BStringView(NULL, "") 32 { 33 SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET)); 34 } 35 36 TextDataView(const char* text) 37 : 38 BStringView(NULL, text) 39 { 40 SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET)); 41 } 42 }; 43 44 45 class AbstractGeneralPage : public BGroupView { 46 public: 47 AbstractGeneralPage(); 48 virtual ~AbstractGeneralPage(); 49 50 protected: 51 TextDataView* AddDataView(const char* label, 52 const char* text = NULL); 53 54 protected: 55 BGridView* fDataView; 56 }; 57 58 59 60 #endif // ABSTRACT_GENERAL_PAGE_H 61