Ho
This commit is contained in:
parent
6be1aad043
commit
13fb5cf3b3
5 changed files with 27 additions and 7 deletions
BIN
.genio
BIN
.genio
Binary file not shown.
BIN
DumBer
BIN
DumBer
Binary file not shown.
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2024 Santiago
|
Copyright (c) 2024 Santiago Lema
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
#include <LayoutBuilder.h>
|
#include <LayoutBuilder.h>
|
||||||
#include <Menu.h>
|
#include <Menu.h>
|
||||||
#include <MenuBar.h>
|
#include <MenuBar.h>
|
||||||
|
#include <Button.h>
|
||||||
|
|
||||||
#include <View.h>
|
#include <View.h>
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
@ -23,11 +25,12 @@ static const uint32 kMsgOpenFile = 'fopn';
|
||||||
static const uint32 kMsgSaveFile = 'fsav';
|
static const uint32 kMsgSaveFile = 'fsav';
|
||||||
|
|
||||||
static const uint32 kSendPrompt = 'kspt';
|
static const uint32 kSendPrompt = 'kspt';
|
||||||
|
static const uint32 kQuestionChanged = 'kqch';
|
||||||
|
|
||||||
|
|
||||||
MainWindow::MainWindow()
|
MainWindow::MainWindow()
|
||||||
:
|
:
|
||||||
BWindow(BRect(100, 100, 500, 400), B_TRANSLATE("BeDumb"), B_TITLED_WINDOW,
|
BWindow(BRect(100, 100, 600, 400), B_TRANSLATE("BeDumb"), B_TITLED_WINDOW,
|
||||||
B_ASYNCHRONOUS_CONTROLS | B_QUIT_ON_WINDOW_CLOSE)
|
B_ASYNCHRONOUS_CONTROLS | B_QUIT_ON_WINDOW_CLOSE)
|
||||||
{
|
{
|
||||||
BMenuBar* menuBar = _BuildMenu();
|
BMenuBar* menuBar = _BuildMenu();
|
||||||
|
@ -36,13 +39,23 @@ MainWindow::MainWindow()
|
||||||
.Add(menuBar)
|
.Add(menuBar)
|
||||||
.AddGlue()
|
.AddGlue()
|
||||||
.End();
|
.End();
|
||||||
|
|
||||||
|
|
||||||
|
BTextControl* input = new BTextControl(B_TRANSLATE("question"), "", new BMessage(kQuestionChanged));
|
||||||
|
BTextView* answerView = new BTextView("answer", B_WILL_DRAW | B_FOLLOW_ALL_SIDES);
|
||||||
|
|
||||||
|
BButton *sendButton = new BButton("send",B_TRANSLATE("ask"),new BMessage(kSendPrompt), B_WILL_DRAW | B_NAVIGABLE);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//BLayoutItem * addMe = new BLayoutItem():
|
||||||
|
|
||||||
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
|
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
|
||||||
.AddGroup(B_HORIZONTAL, 0)
|
.AddGroup(B_HORIZONTAL, 0)
|
||||||
// .Add(new BTextControl("Input 1", "Label 1", "Default text"))
|
.Add(input)
|
||||||
// .Add(new BButton("Go", new BMessage(kSendPrompt))
|
.Add(sendButton)
|
||||||
.End()
|
.End()
|
||||||
// .Add(new BTextView("Text View", new BRect(0, 0, 10, 10), B_FOLLOW_ALL_SIDES, B_WILL_DRAW))
|
.Add(answerView)
|
||||||
.SetInsets(5, 5, 5, 5)
|
.SetInsets(5, 5, 5, 5)
|
||||||
.End();
|
.End();
|
||||||
|
|
||||||
|
@ -76,6 +89,13 @@ MainWindow::MessageReceived(BMessage* message)
|
||||||
printf("Save\n");
|
printf("Save\n");
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
case kSendPrompt:
|
||||||
|
{
|
||||||
|
printf("Sending Prompt...");
|
||||||
|
|
||||||
|
} break;
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
BWindow::MessageReceived(message);
|
BWindow::MessageReceived(message);
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
# Dumber AI
|
# DumBer
|
||||||
|
|
||||||
a simple native Haiku OpenAI / ChatGPT Client
|
A simple native Haiku OpenAI / ChatGPT Client
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue