This commit is contained in:
Santiago Lema 2024-09-29 19:37:24 -03:00
parent 6be1aad043
commit 13fb5cf3b3
5 changed files with 27 additions and 7 deletions

BIN
.genio

Binary file not shown.

BIN
DumBer

Binary file not shown.

View file

@ -1,6 +1,6 @@
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:

View file

@ -11,6 +11,8 @@
#include <LayoutBuilder.h>
#include <Menu.h>
#include <MenuBar.h>
#include <Button.h>
#include <View.h>
#include <cstdio>
@ -23,11 +25,12 @@ static const uint32 kMsgOpenFile = 'fopn';
static const uint32 kMsgSaveFile = 'fsav';
static const uint32 kSendPrompt = 'kspt';
static const uint32 kQuestionChanged = 'kqch';
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)
{
BMenuBar* menuBar = _BuildMenu();
@ -37,12 +40,22 @@ MainWindow::MainWindow()
.AddGlue()
.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)
.AddGroup(B_HORIZONTAL, 0)
// .Add(new BTextControl("Input 1", "Label 1", "Default text"))
// .Add(new BButton("Go", new BMessage(kSendPrompt))
.Add(input)
.Add(sendButton)
.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)
.End();
@ -76,6 +89,13 @@ MainWindow::MessageReceived(BMessage* message)
printf("Save\n");
} break;
case kSendPrompt:
{
printf("Sending Prompt...");
} break;
default:
{
BWindow::MessageReceived(message);

View file

@ -1,3 +1,3 @@
# Dumber AI
# DumBer
a simple native Haiku OpenAI / ChatGPT Client
A simple native Haiku OpenAI / ChatGPT Client