void CalcView::_Init(BMessage* settings) { // create expression text view fExpressionTextView = new ExpressionTextView(_ExpressionRect(), this); AddChild(fExpressionTextView); // read data from archive _LoadSettings(settings); // fetch the calc icon for compact view _FetchAppIcon(fCalcIcon); fAboutWindow = NULL; }
void CalcView::_Init(BMessage* settings) { // create expression text view fExpressionTextView = new ExpressionTextView(_ExpressionRect(), this); AddChild(fExpressionTextView); // read data from archive _LoadSettings(settings); // fetch the calc icon for compact view _FetchAppIcon(fCalcIcon); fEvaluateSemaphore = create_sem(1, "Evaluate Semaphore"); }
CalcView::CalcView(BRect frame, rgb_color rgbBaseColor, BMessage* settings) : BView(frame, "DeskCalc", B_FOLLOW_ALL_SIDES, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_FRAME_EVENTS), fColumns(5), fRows(4), fBaseColor(rgbBaseColor), fExpressionBGColor((rgb_color){ 0, 0, 0, 255 }), fWidth(1), fHeight(1), fKeypadDescription(strdup(kKeypadDescriptionBasic)), fKeypad(NULL), #ifdef __HAIKU__ fCalcIcon(new BBitmap(BRect(0, 0, 15, 15), 0, B_RGBA32)), #else fCalcIcon(new BBitmap(BRect(0, 0, 15, 15), 0, B_CMAP8)), #endif fPopUpMenu(NULL), fAutoNumlockItem(NULL), fAudioFeedbackItem(NULL), fOptions(new CalcOptions()) { // create expression text view fExpressionTextView = new ExpressionTextView(_ExpressionRect(), this); AddChild(fExpressionTextView); // read data from archive _LoadSettings(settings); // tell the app server not to erase our b/g SetViewColor(B_TRANSPARENT_32_BIT); // parse calculator description _ParseCalcDesc(fKeypadDescription); // colorize based on base color. _Colorize(); // Fetch the calc icon for compact view _FetchAppIcon(fCalcIcon); }
CalcView::CalcView(BMessage* archive) : BView(archive), fColumns(5), fRows(4), fBaseColor((rgb_color){ 128, 128, 128, 255 }), fExpressionBGColor((rgb_color){ 0, 0, 0, 255 }), fWidth(1), fHeight(1), fKeypadDescription(strdup(kKeypadDescriptionBasic)), fKeypad(NULL), #ifdef __HAIKU__ fCalcIcon(new BBitmap(BRect(0, 0, 15, 15), 0, B_RGBA32)), #else fCalcIcon(new BBitmap(BRect(0, 0, 15, 15), 0, B_CMAP8)), #endif fPopUpMenu(NULL), fAutoNumlockItem(NULL), fAudioFeedbackItem(NULL), fOptions(new CalcOptions()) { // Do not restore the follow mode, in shelfs, we never follow. SetResizingMode(B_FOLLOW_NONE); // create expression text view fExpressionTextView = new ExpressionTextView(_ExpressionRect(), this); AddChild(fExpressionTextView); // read data from archive _LoadSettings(archive); // Fetch the calc icon for compact view _FetchAppIcon(fCalcIcon); }