Nebula: Convert fixed length char array to BString
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
#include <LayoutBuilder.h>
|
#include <LayoutBuilder.h>
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
#include <ScreenSaver.h>
|
#include <ScreenSaver.h>
|
||||||
|
#include <String.h>
|
||||||
#include <SupportDefs.h>
|
#include <SupportDefs.h>
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
@@ -465,15 +466,16 @@ SettingsView::SettingsView(BRect frame)
|
|||||||
|
|
||||||
popMenu = new BPopUpMenu("");
|
popMenu = new BPopUpMenu("");
|
||||||
for (int32 i = 0; i < widthsLength; i++) {
|
for (int32 i = 0; i < widthsLength; i++) {
|
||||||
BMessage* message = new BMessage(kMsgWidth);
|
BString label;
|
||||||
char label[64];
|
|
||||||
if (widths[i] == 0)
|
if (widths[i] == 0)
|
||||||
sprintf(label, "screen resolution");
|
label.SetTo("screen resolution");
|
||||||
else
|
else
|
||||||
sprintf(label, "%ld pixels", widths[i]);
|
label.SetToFormat("%ld pixels", widths[i]);
|
||||||
|
|
||||||
|
BMessage* message = new BMessage(kMsgWidth);
|
||||||
message->AddInt32("width", widths[i]);
|
message->AddInt32("width", widths[i]);
|
||||||
popMenu->AddItem(item = new BMenuItem(label, message));
|
|
||||||
|
popMenu->AddItem(item = new BMenuItem(label.String(), message));
|
||||||
|
|
||||||
if (gSettingsWidth == widths[i])
|
if (gSettingsWidth == widths[i])
|
||||||
item->SetMarked(true);
|
item->SetMarked(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user