[interfacekit] Re: TextRequestDialog
- From: Alan Westbrook <alan@xxxxxxxxxxxxxx>
- To: interfacekit@xxxxxxxxxxxxx
- Date: Fri, 26 Mar 2004 23:58:03 -0800
THe dialog sounds like a good idea.
Here's some code for that screen thing:
#include <Rect.h>
#include <Screen.h>
BRect& center_on_screen(BRect& _rect)
{
BRect r = BScreen().Frame();
_rect.OffsetTo((r.Width() - Rect.Width()) / 2.0,
(r.Height() - Rect.Height()) / 2.0);
return _rect;
}
I recommend putting the func in InterfaceDefs
Alan
Waldemar Kornewald wrote:
Hi,
do we have a general BAlert-like window class with a BTextControl in it so that the user can enter
a string and press "OK" or "Cancel"? I need this for the DialUpPreflet (ask
user for the new interface's name). If not, shall I write it and commit it into some more public
folder so that people can reuse it (but my class would be _very_ simple)?
Also, what do you think of a small function that helps positioning windows on
the screen?
E.g.:
BRect get_window_rect_for_screen_center(float width, float height)
or
void move_window_to_screen_center(BRect *frame)
What about a small file that lists all available utilities in our repository?
Bye,
Waldemar
- Follow-Ups:
- [interfacekit] Re: TextRequestDialog
- From: Waldemar Kornewald
- References:
- [interfacekit] TextRequestDialog
- From: Waldemar Kornewald
Other related posts:
- » [interfacekit] TextRequestDialog
- » [interfacekit] Re: TextRequestDialog
- » [interfacekit] Re: TextRequestDialog
- » [interfacekit] Re: TextRequestDialog
- » [interfacekit] Re: TextRequestDialog
- » [interfacekit] Re: TextRequestDialog
- » [interfacekit] Re: TextRequestDialog
- » [interfacekit] Re: TextRequestDialog
- » [interfacekit] Re: TextRequestDialog
- » [interfacekit] Re: TextRequestDialog
- » [interfacekit] Re: TextRequestDialog
- » [interfacekit] Re: TextRequestDialog
- » [interfacekit] Re: TextRequestDialog
- » [interfacekit] Re: TextRequestDialog
- » [interfacekit] Re: TextRequestDialog
- » [interfacekit] Re: TextRequestDialog
#include <Rect.h> #include <Screen.h>
Hi, do we have a general BAlert-like window class with a BTextControl in it so that the user can enter a string and press "OK" or "Cancel"? I need this for the DialUpPreflet (ask user for the new interface's name). If not, shall I write it and commit it into some more public folder so that people can reuse it (but my class would be _very_ simple)? Also, what do you think of a small function that helps positioning windows on the screen? E.g.: BRect get_window_rect_for_screen_center(float width, float height) or void move_window_to_screen_center(BRect *frame) What about a small file that lists all available utilities in our repository?
Bye, Waldemar
- [interfacekit] Re: TextRequestDialog
- From: Waldemar Kornewald
- [interfacekit] TextRequestDialog
- From: Waldemar Kornewald