diff --git a/src/kits/interface/ColorControl.cpp b/src/kits/interface/ColorControl.cpp
index 0379cd5..8799136 100644
a
|
b
|
BColorControl::BColorControl(BPoint leftTop, color_control_layout layout,
|
52 | 52 | float cellSize, const char* name, BMessage* message, bool bufferedDrawing) |
53 | 53 | : |
54 | 54 | BControl(BRect(leftTop, leftTop), name, NULL, message, |
55 | | B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE) |
| 55 | B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE), |
| 56 | fRedText(NULL), |
| 57 | fGreenText(NULL), |
| 58 | fBlueText(NULL), |
| 59 | fBitmap(NULL), |
| 60 | fOffscreenView(NULL) |
56 | 61 | { |
57 | 62 | _InitData(layout, cellSize, bufferedDrawing, NULL); |
58 | 63 | } |
… |
… |
BColorControl::BColorControl(BPoint leftTop, color_control_layout layout,
|
60 | 65 | |
61 | 66 | BColorControl::BColorControl(BMessage* data) |
62 | 67 | : |
63 | | BControl(data) |
| 68 | BControl(data), |
| 69 | fRedText(NULL), |
| 70 | fGreenText(NULL), |
| 71 | fBlueText(NULL), |
| 72 | fBitmap(NULL), |
| 73 | fOffscreenView(NULL) |
64 | 74 | { |
65 | 75 | int32 layout; |
66 | 76 | float cellSize; |
… |
… |
BColorControl::_InitData(color_control_layout layout, float size,
|
174 | 184 | ResizeToPreferred(); |
175 | 185 | |
176 | 186 | if (useOffscreen) { |
177 | | BRect bounds = _PaletteFrame(); |
178 | | fBitmap = new BBitmap(bounds, B_RGB32, true, false); |
179 | | fOffscreenView = new BView(bounds, "off_view", 0, 0); |
180 | | |
181 | | fBitmap->Lock(); |
182 | | fBitmap->AddChild(fOffscreenView); |
183 | | fBitmap->Unlock(); |
| 187 | if (fOffscreenView != NULL) { |
| 188 | BRect bounds = _PaletteFrame(); |
| 189 | fBitmap = new BBitmap(bounds, B_RGB32, true, false); |
| 190 | fOffscreenView = new BView(bounds, "off_view", 0, 0); |
| 191 | |
| 192 | fBitmap->Lock(); |
| 193 | fBitmap->AddChild(fOffscreenView); |
| 194 | fBitmap->Unlock(); |
| 195 | } |
184 | 196 | } else { |
185 | 197 | fBitmap = NULL; |
186 | 198 | fOffscreenView = NULL; |
… |
… |
BColorControl::MessageReceived(BMessage* message)
|
362 | 374 | Invoke(); |
363 | 375 | break; |
364 | 376 | } |
| 377 | |
| 378 | case B_SCREEN_CHANGED: |
| 379 | { |
| 380 | BRect frame; |
| 381 | uint32 mode; |
| 382 | if (message->FindRect("frame", &frame) == B_OK |
| 383 | && message->FindInt32("mode", (int32*)&mode) == B_OK) { |
| 384 | if ((fPaletteMode && mode == B_CMAP8) |
| 385 | || (!fPaletteMode && mode != B_CMAP8)) { |
| 386 | // not switching to or from B_CMAP8, break |
| 387 | break; |
| 388 | } |
| 389 | |
| 390 | // fake an archive message (so we don't rebuild views) |
| 391 | BMessage* data = new BMessage(); |
| 392 | data->AddInt32("_val", Value()); |
| 393 | |
| 394 | // reinititialize |
| 395 | bool useOffscreen = fOffscreenView != NULL; |
| 396 | _InitData((color_control_layout)fColumns, fCellSize, |
| 397 | useOffscreen, data); |
| 398 | if (useOffscreen) |
| 399 | _InitOffscreen(); |
| 400 | |
| 401 | // cleanup |
| 402 | delete data; |
| 403 | } |
| 404 | break; |
| 405 | } |
| 406 | |
365 | 407 | default: |
366 | 408 | BControl::MessageReceived(message); |
367 | 409 | } |
diff --git a/src/kits/interface/View.cpp b/src/kits/interface/View.cpp
index cf03b8f..7f94992 100644
a
|
b
|
BView::MessageReceived(BMessage* message)
|
4955 | 4955 | case B_FONTS_UPDATED: |
4956 | 4956 | break; |
4957 | 4957 | |
| 4958 | case B_SCREEN_CHANGED: |
| 4959 | { |
| 4960 | BRect frame; |
| 4961 | uint32 mode; |
| 4962 | if (message->FindRect("frame", &frame) == B_OK |
| 4963 | && message->FindInt32("mode", (int32*)&mode) == B_OK) { |
| 4964 | // propegate message to child views |
| 4965 | for (int32 i = 0; i < CountChildren(); i++) { |
| 4966 | BView* view = ChildAt(i); |
| 4967 | if (view != NULL) |
| 4968 | view->MessageReceived(message); |
| 4969 | } |
| 4970 | } |
| 4971 | break; |
| 4972 | } |
| 4973 | |
4958 | 4974 | default: |
4959 | 4975 | BHandler::MessageReceived(message); |
4960 | 4976 | break; |
diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp
index 7a6b203..887b8b8 100644
a
|
b
|
FrameMoved(origin);
|
1111 | 1111 | BRect frame; |
1112 | 1112 | uint32 mode; |
1113 | 1113 | if (message->FindRect("frame", &frame) == B_OK |
1114 | | && message->FindInt32("mode", (int32*)&mode) == B_OK) |
| 1114 | && message->FindInt32("mode", (int32*)&mode) == B_OK) { |
| 1115 | // propegate message to child views |
| 1116 | for (int32 i = 0; i < CountChildren(); i++) { |
| 1117 | BView* view = ChildAt(i); |
| 1118 | if (view != NULL) |
| 1119 | view->MessageReceived(message); |
| 1120 | } |
| 1121 | // call hook method |
1115 | 1122 | ScreenChanged(frame, (color_space)mode); |
| 1123 | } |
1116 | 1124 | } else |
1117 | 1125 | target->MessageReceived(message); |
1118 | 1126 | break; |