[interfacekit] Re: TextRequestDialog

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



Other related posts: