* Use layout API in libprint dialogs.
* Use layout API in preview printer add-on. * Use layout API in some dialogs in PDF Writer. * Removed unused class PrinterSetupWindow from PDF Writer. * Improved layout in print_server configuration dialog. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38986 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -17,15 +17,12 @@
|
||||
class JSDSlider : public BSlider
|
||||
{
|
||||
public:
|
||||
JSDSlider(BRect frame, const char* name, const char *label,
|
||||
BMessage *msg, int32 min, int32 max, thumb_style t);
|
||||
JSDSlider(const char* name, const char* label,
|
||||
BMessage* msg, int32 min, int32 max);
|
||||
|
||||
virtual ~JSDSlider();
|
||||
#ifdef __HAIKU__
|
||||
virtual const char* UpdateText() const;
|
||||
#else
|
||||
virtual char* UpdateText() const;
|
||||
#endif
|
||||
|
||||
private:
|
||||
mutable BString fResult;
|
||||
};
|
||||
|
||||
@@ -26,14 +26,15 @@ class PagesView;
|
||||
|
||||
class JobSetupView : public BView {
|
||||
public:
|
||||
JobSetupView(BRect frame, JobData *job_data, PrinterData *printer_data, const PrinterCap *printer_cap);
|
||||
JobSetupView(JobData* job_data, PrinterData* printer_data,
|
||||
const PrinterCap* printer_cap);
|
||||
virtual void AttachedToWindow();
|
||||
virtual void MessageReceived(BMessage *msg);
|
||||
virtual void MessageReceived(BMessage* msg);
|
||||
bool UpdateJobData(bool showPreview);
|
||||
|
||||
private:
|
||||
void UpdateButtonEnabledState();
|
||||
BRadioButton* AddPageSelectionItem(BView* parent, BRect rect, const char* name, const char* label,
|
||||
BRadioButton* CreatePageSelectionItem(const char* name, const char* label,
|
||||
JobData::PageSelection pageSelection);
|
||||
void AllowOnlyDigits(BTextView* textView, int maxDigits);
|
||||
JobData::Color getColor();
|
||||
|
||||
@@ -143,6 +143,24 @@ enum MarginUnit {
|
||||
kUnitPoint
|
||||
};
|
||||
|
||||
class PageView : public BView
|
||||
{
|
||||
public:
|
||||
PageView();
|
||||
|
||||
void SetPageSize(float pageWidth, float pageHeight);
|
||||
void SetMargins(BRect margins);
|
||||
|
||||
virtual void Draw(BRect bounds);
|
||||
|
||||
|
||||
private:
|
||||
float fPageWidth;
|
||||
float fPageHeight;
|
||||
|
||||
BRect fMargins;
|
||||
};
|
||||
|
||||
/**
|
||||
* Class MarginView
|
||||
*/
|
||||
@@ -151,7 +169,7 @@ class MarginView : public BBox
|
||||
friend class MarginManager;
|
||||
|
||||
public:
|
||||
MarginView(BRect rect, int32 pageWidth = 0,
|
||||
MarginView(int32 pageWidth = 0,
|
||||
int32 pageHeight = 0,
|
||||
BRect margins = BRect(1, 1, 1, 1), // 1 inch
|
||||
MarginUnit unit = kUnitInch);
|
||||
@@ -159,8 +177,6 @@ public:
|
||||
virtual ~MarginView();
|
||||
|
||||
virtual void AttachedToWindow();
|
||||
virtual void Draw(BRect rect);
|
||||
virtual void FrameResized(float width, float height);
|
||||
virtual void MessageReceived(BMessage *msg);
|
||||
|
||||
// point.x = width, point.y = height
|
||||
@@ -190,33 +206,25 @@ private:
|
||||
// performed internally using the supplied popup
|
||||
void _SetMarginUnit(MarginUnit unit);
|
||||
|
||||
// Calculate the view size for the margins
|
||||
void _CalculateViewSize(uint32 msg);
|
||||
|
||||
private:
|
||||
BTextControl* fTop;
|
||||
BTextControl* fBottom;
|
||||
BTextControl* fLeft;
|
||||
BTextControl* fRight;
|
||||
|
||||
// rect that holds the margins for the page as a set of point offsets
|
||||
BRect fMargins;
|
||||
|
||||
// the maximum size of the page view calculated from the view size
|
||||
float fMaxPageWidth;
|
||||
float fMaxPageHeight;
|
||||
|
||||
// the actual size of the page in points
|
||||
float fPageHeight;
|
||||
float fPageWidth;
|
||||
|
||||
// rect that holds the margins for the page as a set of point offsets
|
||||
BRect fMargins;
|
||||
|
||||
// the units used to calculate the page size
|
||||
MarginUnit fMarginUnit;
|
||||
float fUnitValue;
|
||||
|
||||
// the size of the drawing area we have to draw the view in pixels
|
||||
float fViewHeight;
|
||||
float fViewWidth;
|
||||
PageView* fPage;
|
||||
BStringView* fPageSize;
|
||||
};
|
||||
|
||||
#endif // _MARGIN_VIEW_H
|
||||
|
||||
@@ -20,7 +20,8 @@ class MarginView;
|
||||
|
||||
class PageSetupView : public BView {
|
||||
public:
|
||||
PageSetupView(BRect frame, JobData *job_data, PrinterData *printer_data, const PrinterCap *printer_cap);
|
||||
PageSetupView(JobData *job_data, PrinterData *printer_data,
|
||||
const PrinterCap *printer_cap);
|
||||
~PageSetupView();
|
||||
virtual void AttachedToWindow();
|
||||
bool UpdateJobData();
|
||||
@@ -43,11 +44,13 @@ private:
|
||||
|
||||
class PageSetupDlg : public DialogWindow {
|
||||
public:
|
||||
PageSetupDlg(JobData *job_data, PrinterData *printer_data, const PrinterCap *printer_cap);
|
||||
PageSetupDlg(JobData *job_data, PrinterData *printer_data,
|
||||
const PrinterCap *printer_cap);
|
||||
virtual void MessageReceived(BMessage *message);
|
||||
|
||||
private:
|
||||
BMessageFilter *fFilter;
|
||||
BMessageFilter* fFilter;
|
||||
PageSetupView* fPageSetupView;
|
||||
};
|
||||
|
||||
#endif /* __PAGESETUPDLG_H */
|
||||
|
||||
Reference in New Issue
Block a user