usability improvements to scrollbar, sorry had no time to include all of Stefanos drawing code yet, other visual improvements
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13535 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -43,9 +43,6 @@
|
||||
//----------------------------------------------------------------
|
||||
//----- BScrollBar class -----------------------------------------
|
||||
|
||||
class BScrollArrowButton;
|
||||
class BScrollBarPrivateData;
|
||||
|
||||
class BScrollBar : public BView {
|
||||
|
||||
public:
|
||||
@@ -104,29 +101,36 @@ virtual status_t Perform(perform_code d, void *arg);
|
||||
|
||||
private:
|
||||
class Private;
|
||||
friend class BScrollArrowButton;
|
||||
friend class Private;
|
||||
|
||||
friend status_t control_scrollbar(scroll_bar_info *info, BScrollBar *bar); // for use within the preflet
|
||||
|
||||
virtual void _ReservedScrollBar1();
|
||||
virtual void _ReservedScrollBar2();
|
||||
virtual void _ReservedScrollBar3();
|
||||
virtual void _ReservedScrollBar4();
|
||||
|
||||
BScrollBar &operator=(const BScrollBar &);
|
||||
void DoScroll(float delta);
|
||||
|
||||
void InitObject(float min, float max, orientation o, BView *t);
|
||||
bool _DoubleArrows() const;
|
||||
void _UpdateThumbFrame();
|
||||
float _ValueFor(BPoint where) const;
|
||||
int32 _ButtonFor(BPoint where) const;
|
||||
BRect _ButtonRectFor(int32 button) const;
|
||||
void _UpdateTargetValue(BPoint where);
|
||||
void _UpdateArrowButtons();
|
||||
void _DrawArrowButton(int32 direction,
|
||||
BRect frame, bool down);
|
||||
|
||||
void DrawButtons(BRect updateRect);
|
||||
|
||||
/* void DrawButtons(BRect updateRect);
|
||||
void DrawArrow(BPoint pos, int32 which, bool pressed = false);
|
||||
void DrawButton(BRect frame, int32 arrowType, bool pressed = false);
|
||||
|
||||
bool DoubleArrows() const;
|
||||
|
||||
|
||||
BRect BarFrame() const;
|
||||
BRect KnobFrame() const;
|
||||
float ValueToPosition(float val) const;
|
||||
float PositionToValue(float pos) const;
|
||||
float PositionToValue(float pos) const;*/
|
||||
|
||||
float fMin;
|
||||
float fMax;
|
||||
@@ -136,9 +140,9 @@ virtual void _ReservedScrollBar4();
|
||||
float fProportion;
|
||||
BView* fTarget;
|
||||
orientation fOrientation;
|
||||
char *fTargetName;
|
||||
char* fTargetName;
|
||||
|
||||
Private *fPrivateData;
|
||||
Private* fPrivateData;
|
||||
|
||||
uint32 _reserved[3];
|
||||
};
|
||||
|
||||
@@ -620,12 +620,15 @@ BAlert::InitIcon()
|
||||
// After a bit of a search, I found the icons in app_server. =P
|
||||
BBitmap* icon = NULL;
|
||||
BPath path;
|
||||
if (find_directory(B_BEOS_SERVERS_DIRECTORY, &path) == B_OK) {
|
||||
status_t status = find_directory(B_BEOS_SERVERS_DIRECTORY, &path);
|
||||
if (status >= B_OK) {
|
||||
path.Append("app_server");
|
||||
BFile file;
|
||||
if (file.SetTo(path.Path(), B_READ_ONLY) == B_OK) {
|
||||
status = file.SetTo(path.Path(), B_READ_ONLY);
|
||||
if (status >= B_OK) {
|
||||
BResources resources;
|
||||
if (resources.SetTo(&file) == B_OK) {
|
||||
status = resources.SetTo(&file);
|
||||
if (status >= B_OK) {
|
||||
// Which icon are we trying to load?
|
||||
const char* iconName = ""; // Don't want any seg faults
|
||||
switch (fMsgType) {
|
||||
@@ -657,9 +660,17 @@ BAlert::InitIcon()
|
||||
// Now build the bitmap
|
||||
icon = new BBitmap(BRect(0, 0, 31, 31), 0, B_CMAP8);
|
||||
icon->SetBits(rawIcon, size, 0, B_CMAP8);
|
||||
} else {
|
||||
fprintf(stderr, "BAlert::InitIcon() - Icon resource not found\n");
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "BAlert::InitIcon() - BResources init failed: %s\n", strerror(status));
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "BAlert::InitIcon() - BFile init failed: %s\n", strerror(status));
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "BAlert::InitIcon() - find_directory failed: %s\n", strerror(status));
|
||||
}
|
||||
|
||||
if (!icon) {
|
||||
|
||||
@@ -613,6 +613,8 @@ BMenuItem::Select(bool on)
|
||||
void
|
||||
BMenuItem::DrawMarkSymbol()
|
||||
{
|
||||
fSuper->SetDrawingMode(B_OP_OVER);
|
||||
|
||||
fSuper->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR),
|
||||
B_DARKEN_1_TINT));
|
||||
fSuper->StrokeLine(BPoint(fBounds.left + 6.0f, fBounds.bottom - 3.0f),
|
||||
@@ -631,6 +633,8 @@ BMenuItem::DrawMarkSymbol()
|
||||
BPoint(fBounds.left + 3.0f, fBounds.bottom - 9.0f));
|
||||
fSuper->StrokeLine(BPoint(fBounds.left + 4.0f, fBounds.bottom - 4.0f),
|
||||
BPoint(fBounds.left + 2.0f, fBounds.bottom - 9.0f));
|
||||
|
||||
fSuper->SetDrawingMode(B_OP_COPY);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+803
-762
File diff suppressed because it is too large
Load Diff
@@ -1832,6 +1832,16 @@ BWindow::ResizeBy(float dx, float dy)
|
||||
fLink->Attach<float>(dy);
|
||||
fLink->Flush();
|
||||
|
||||
/* int32 code;
|
||||
if (fLink->FlushWithReply(code) == B_OK
|
||||
&& code == SERVER_TRUE) {
|
||||
fLink->Read<float>(&dx);
|
||||
fLink->Read<float>(&dy);
|
||||
|
||||
fFrame.SetRightBottom(fFrame.LeftTop() + BPoint(dx, dy));
|
||||
top_view->ResizeTo(dx, dy);
|
||||
}*/
|
||||
|
||||
fFrame.SetRightBottom(fFrame.RightBottom() + BPoint(dx, dy));
|
||||
top_view->ResizeBy(dx, dy);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user