[openbeos] Re: office suite(s)

  • From: François Revol <revol@xxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Sun, 30 Mar 2003 22:53:19 +0200 (CEST)

En réponse à "Bruno G. Albuquerque" <bga@xxxxxxxxxxxxx>:

> On Sun, 30 Mar 2003, Gavin James wrote:
> 
> > Is this a direct result of the application being replicant enabled?
> i.e.
> > could it be done with soundplay as well? 
> 
> Yes.
> 
> -Bruno
> 

And it's really easy (hmm that would make a nice subject for a newsletter
article if I had time :).

Btw, this belongs to bedevtalk.

François.

/* ShelfTest.cpp */
/* LDFLAGS="-lbe" make ShelfTest */

#include <stdio.h>
#include <Application.h>
#include <Message.h>
#include <Shelf.h>
#include <View.h>
#include <Window.h>

int main(int argc, char **argv)
{
        BRect windowBounds(0, 0, 300, 300);
        new BApplication("application/x-vnd.mmu_man.ShelfTest");

        if (!be_app)
                return 1;
        BWindow *win;
        win = new BWindow(windowBounds.OffsetByCopy(50, 50), "ShelfTest", 
B_DOCUMENT_WINDOW, B_WILL_ACCEPT_FIRST_CLICK | B_QUIT_ON_WINDOW_CLOSE);
        BView *view;
        view = new BView(windowBounds, "ShelfTestView", B_FOLLOW_ALL, 
B_WILL_DRAW | B_FRAME_EVENTS);
        view->SetViewColor(0, 0, 255);
        win->AddChild(view);
        BShelf *shelf;
        shelf = new BShelf(view, false, "theShelf");
        BMessage *replicant;
        replicant = new BMessage(B_ARCHIVED_OBJECT);
        replicant->AddString("add_on", "application/x-vnd.Be-NPOS");
        replicant->AddInt32("version", 2);
        replicant->AddString("url", "http://openbeos.org/";);
        replicant->AddBool("openAsText", false);
        replicant->AddInt32("encoding", 258);
        replicant->AddString("class", "NPBaseView");
        replicant->AddString("_name", "NetPositive");
        //windowBounds.top -= 20;
        //windowBounds.bottom += 30;
        replicant->AddRect("_frame", windowBounds);
        replicant->AddInt32("_resize_mode", 0x00001234 /*B_FOLLOW_ALL*/);
        replicant->AddInt32("_flags", 0x24000000);

        replicant->PrintToStream();
        shelf->AddReplicant(replicant, BPoint(0, 0));
        BView *repview = view->ChildAt(0);
        if (repview) {
                printf("rep flags=0x%08lx resizemode=0x%08lx\n", 
repview->Flags(), repview->ResizingMode());
                repview->SetResizingMode(B_FOLLOW_ALL);
                repview->MoveBy(0, -28);
                repview->ResizeBy(0, 42);
        }
        win->Show();
        be_app->Run();
        delete be_app;
}






Other related posts: