diff --git a/.genio b/.genio index c6ad6d2..32e3d1d 100644 Binary files a/.genio and b/.genio differ diff --git a/DumBer b/DumBer index 59299f2..f119170 100755 Binary files a/DumBer and b/DumBer differ diff --git a/LICENSE b/LICENSE index 11b812b..9bb0d38 100644 --- a/LICENSE +++ b/LICENSE @@ -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: diff --git a/MainWindow.cpp b/MainWindow.cpp index a55bc3f..6523f77 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -11,6 +11,8 @@ #include #include #include +#include + #include #include @@ -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(); @@ -36,13 +39,23 @@ MainWindow::MainWindow() .Add(menuBar) .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); diff --git a/README.md b/README.md index d465817..6cf87d1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -# Dumber AI +# DumBer -a simple native Haiku OpenAI / ChatGPT Client +A simple native Haiku OpenAI / ChatGPT Client