fix my name encoding
added a few comonents git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14217 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2005, Jérôme Duval. All rights reserved.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*
|
||||||
|
* Reworked from DarkWyrm version in CDPlayer
|
||||||
|
*/
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "DrawButton.h"
|
||||||
|
|
||||||
|
DrawButton::DrawButton(BRect frame, const char *name, const char *labelOn, const char* labelOff,
|
||||||
|
BMessage *msg, int32 resize, int32 flags)
|
||||||
|
: PaneSwitch(frame, name, "", resize, flags)
|
||||||
|
{
|
||||||
|
fLabelOn = strdup(labelOn);
|
||||||
|
fLabelOff = strdup(labelOff);
|
||||||
|
SetMessage(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DrawButton::~DrawButton(void)
|
||||||
|
{
|
||||||
|
free(fLabelOn);
|
||||||
|
free(fLabelOff);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
DrawButton::Draw(BRect update)
|
||||||
|
{
|
||||||
|
BPoint point(18,9);
|
||||||
|
if (Value()) {
|
||||||
|
DrawString(fLabelOn, point);
|
||||||
|
} else {
|
||||||
|
DrawString(fLabelOff, point);
|
||||||
|
}
|
||||||
|
PaneSwitch::Draw(update);
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2005, Jérôme Duval. All rights reserved.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*
|
||||||
|
* Reworked from DarkWyrm version in CDPlayer
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _DRAW_BUTTON_H
|
||||||
|
#define _DRAW_BUTTON_H
|
||||||
|
|
||||||
|
#include "DialogPane.h"
|
||||||
|
|
||||||
|
class DrawButton : public PaneSwitch
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DrawButton(BRect frame, const char *name, const char *labelOn, const char* labelOff,
|
||||||
|
BMessage *msg, int32 resize = B_FOLLOW_LEFT|B_FOLLOW_TOP,
|
||||||
|
int32 flags = B_WILL_DRAW | B_NAVIGABLE);
|
||||||
|
~DrawButton(void);
|
||||||
|
|
||||||
|
void Draw(BRect update);
|
||||||
|
private:
|
||||||
|
char* fLabelOn, *fLabelOff;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2005, Jérôme DUVAL. All rights reserved.
|
* Copyright 2005, Jérôme DUVAL. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2005, Jérôme DUVAL. All rights reserved.
|
* Copyright 2005, Jérôme DUVAL. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2005, Jérôme DUVAL. All rights reserved.
|
* Copyright 2005, Jérôme DUVAL. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <Box.h>
|
#include <Box.h>
|
||||||
|
#include "DrawButton.h"
|
||||||
#include "InstallerWindow.h"
|
#include "InstallerWindow.h"
|
||||||
|
|
||||||
|
const uint32 BEGIN_MESSAGE = 'iBMG';
|
||||||
|
const uint32 SHOW_BOTTOM_MESSAGE = 'iSMG';
|
||||||
|
|
||||||
InstallerWindow::InstallerWindow(BRect frame_rect)
|
InstallerWindow::InstallerWindow(BRect frame_rect)
|
||||||
: BWindow(frame_rect, "Installer", B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_NOT_RESIZABLE)
|
: BWindow(frame_rect, "Installer", B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_NOT_RESIZABLE)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
BRect bounds = Bounds();
|
||||||
|
bounds.bottom += 1;
|
||||||
|
bounds.right += 1;
|
||||||
|
fBackBox = new BBox(bounds, NULL, B_FOLLOW_ALL, B_WILL_DRAW | B_FRAME_EVENTS, B_FANCY_BORDER);
|
||||||
|
AddChild(fBackBox);
|
||||||
|
|
||||||
|
fBeginButton = new BButton(BRect(bounds.right-90, bounds.bottom-34, bounds.right-10, bounds.bottom-10),
|
||||||
|
"begin_button", "Begin", new BMessage(BEGIN_MESSAGE));
|
||||||
|
fBeginButton->MakeDefault(true);
|
||||||
|
fBackBox->AddChild(fBeginButton);
|
||||||
|
|
||||||
|
DrawButton *drawButton = new DrawButton(BRect(bounds.left+12, bounds.bottom-33, bounds.left+100, bounds.bottom-20),
|
||||||
|
"options_button", "Fewer options", "More options", new BMessage(SHOW_BOTTOM_MESSAGE));
|
||||||
|
fBackBox->AddChild(drawButton);
|
||||||
|
|
||||||
// finish creating window
|
// finish creating window
|
||||||
Show();
|
Show();
|
||||||
}
|
}
|
||||||
@@ -24,6 +43,10 @@ void
|
|||||||
InstallerWindow::MessageReceived(BMessage *msg)
|
InstallerWindow::MessageReceived(BMessage *msg)
|
||||||
{
|
{
|
||||||
switch (msg->what) {
|
switch (msg->what) {
|
||||||
|
case BEGIN_MESSAGE:
|
||||||
|
break;
|
||||||
|
case SHOW_BOTTOM_MESSAGE:
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
BWindow::MessageReceived(msg);
|
BWindow::MessageReceived(msg);
|
||||||
break;
|
break;
|
||||||
@@ -37,3 +60,14 @@ InstallerWindow::QuitRequested()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
InstallerWindow::ShowBottom(bool show)
|
||||||
|
{
|
||||||
|
if (show) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2005, Jérôme DUVAL. All rights reserved.
|
* Copyright 2005, Jérôme DUVAL. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _InstallerWindow_h
|
#ifndef _InstallerWindow_h
|
||||||
#define _InstallerWindow_h
|
#define _InstallerWindow_h
|
||||||
|
|
||||||
|
#include <Box.h>
|
||||||
|
#include <Button.h>
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
|
|
||||||
class InstallerWindow : public BWindow {
|
class InstallerWindow : public BWindow {
|
||||||
@@ -17,6 +19,9 @@ public:
|
|||||||
virtual bool QuitRequested();
|
virtual bool QuitRequested();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void ShowBottom(bool show);
|
||||||
|
BBox *fBackBox;
|
||||||
|
BButton *fBeginButton;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _InstallerWindow_h */
|
#endif /* _InstallerWindow_h */
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
SubDir OBOS_TOP src apps installer ;
|
SubDir OBOS_TOP src apps installer ;
|
||||||
|
|
||||||
|
UsePrivateHeaders shared ;
|
||||||
|
SubDirHdrs [ FDirName $(OBOS_TOP) src kits tracker ] ;
|
||||||
|
|
||||||
App Installer :
|
App Installer :
|
||||||
|
DrawButton.cpp
|
||||||
InstallerApp.cpp
|
InstallerApp.cpp
|
||||||
InstallerWindow.cpp
|
InstallerWindow.cpp
|
||||||
: libbe.so
|
: libbe.so libtracker.so
|
||||||
: Installer.rdef ;
|
: Installer.rdef ;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user