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:
Jérôme Duval 2005-09-21 10:13:46 +00:00
parent 8b7c3f785c
commit d98ceebb35
7 changed files with 112 additions and 5 deletions

View File

@ -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);
}

View File

@ -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

View File

@ -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.
*/

View File

@ -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.
*/

View File

@ -1,15 +1,34 @@
/*
* 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.
*/
#include <Application.h>
#include <Box.h>
#include "DrawButton.h"
#include "InstallerWindow.h"
const uint32 BEGIN_MESSAGE = 'iBMG';
const uint32 SHOW_BOTTOM_MESSAGE = 'iSMG';
InstallerWindow::InstallerWindow(BRect frame_rect)
: 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
Show();
@ -24,6 +43,10 @@ void
InstallerWindow::MessageReceived(BMessage *msg)
{
switch (msg->what) {
case BEGIN_MESSAGE:
break;
case SHOW_BOTTOM_MESSAGE:
break;
default:
BWindow::MessageReceived(msg);
break;
@ -37,3 +60,14 @@ InstallerWindow::QuitRequested()
return true;
}
void
InstallerWindow::ShowBottom(bool show)
{
if (show) {
} else {
}
}

View File

@ -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.
*/
#ifndef _InstallerWindow_h
#define _InstallerWindow_h
#include <Box.h>
#include <Button.h>
#include <Window.h>
class InstallerWindow : public BWindow {
@ -17,6 +19,9 @@ public:
virtual bool QuitRequested();
private:
void ShowBottom(bool show);
BBox *fBackBox;
BButton *fBeginButton;
};
#endif /* _InstallerWindow_h */

View File

@ -1,8 +1,12 @@
SubDir OBOS_TOP src apps installer ;
UsePrivateHeaders shared ;
SubDirHdrs [ FDirName $(OBOS_TOP) src kits tracker ] ;
App Installer :
DrawButton.cpp
InstallerApp.cpp
InstallerWindow.cpp
: libbe.so
: libbe.so libtracker.so
: Installer.rdef ;