BView* IPCPAddon::CreateView(BPoint leftTop) { if(!fIPCPView) { BRect rect; Addons()->FindRect(DUN_TAB_VIEW_RECT, &rect); fIPCPView = new IPCPView(this, rect); fIPCPView->Reload(); } fIPCPView->MoveTo(leftTop); return fIPCPView; }
BView* ConnectionOptionsAddon::CreateView(BPoint leftTop) { if(!fConnectionOptionsView) { BRect rect; Addons()->FindRect(DUN_TAB_VIEW_RECT, &rect); fConnectionOptionsView = new ConnectionOptionsView(this, rect); fConnectionOptionsView->Reload(); } fConnectionOptionsView->MoveTo(leftTop); return fConnectionOptionsView; }
bool PPPoEAddon::GetPreferredSize(float *width, float *height) const { float viewWidth; if(Addons()->FindFloat(DUN_DEVICE_VIEW_WIDTH, &viewWidth) != B_OK) viewWidth = 270; // default value if(width) *width = viewWidth; if(height) *height = fHeight; return true; }
bool IPCPAddon::GetPreferredSize(float *width, float *height) const { BRect rect; if(Addons()->FindRect(DUN_TAB_VIEW_RECT, &rect) != B_OK) rect.Set(0, 0, 200, 300); // set default values if(width) *width = rect.Width(); if(height) *height = rect.Height(); return true; }
BView* PPPoEAddon::CreateView(BPoint leftTop) { if(!fPPPoEView) { float width; if(!Addons()->FindFloat(DUN_DEVICE_VIEW_WIDTH, &width)) width = 270; // default value BRect rect(0, 0, width, fHeight); fPPPoEView = new PPPoEView(this, rect); fPPPoEView->Reload(); } fPPPoEView->MoveTo(leftTop); return fPPPoEView; }