programming

iotd17feb2006.. starting to look like something.



only slightly hacked here and there. the very basic windowing is there. i think that i might go ahead and keep the winfx and winforms version in sync. that'll keep me at least semi-honest as the two are quite different in design. if i was a real trooper i'd choose a linux toolkit as well, but i'm not.

btw. maybe i should get around to my post on how in the hell can c++/cli running .net can be cross-platform. i'm not talking about mono either. it's a much crazier idea than that.

Code:
#include "gamebasis/code/Application.hpp"
#include "gamebasis/code/Label.hpp"
#include "gamebasis/code/StackPanel.hpp"
#include "gamebasis/code/Viewport.hpp"
#include "gamebasis/code/Window.hpp"

#include "gamebasis/code/winforms/NativeWindow.hpp"

using namespace gamebasis;


[System::STAThreadAttribute]
int main(array<System::String ^> ^args)
{
   Application^ application=gcnew Application();
      
   StackPanel^ stackPanelA=gcnew StackPanel(true);
   stackPanelA->Visible=true;

   {
      Label^ label=gcnew Label();
      label->Parent=stackPanelA;
      label->Text="Label AA";
      label->Visible=true;
   }
   
   StackPanel^ stackPanelB=gcnew StackPanel(false);
   stackPanelB->Parent=stackPanelA;
   stackPanelB->Visible=true;
   
   {
      Label^ label=gcnew Label();
      label->Parent=stackPanelB;
      label->Text="Label BA";
      label->Visible=true;
   }   

   Viewport^ viewport=gcnew Viewport();
   viewport->Parent=stackPanelB;
   viewport->Visible=true;
   
   Label^ lame=gcnew Label();
   lame->Position=int2(20,20);
   lame->Parent=viewport;
   lame->Text="Lame";
   lame->Visible=true;   

   {
      Label^ label=gcnew Label();
      label->Parent=stackPanelB;
      label->Text="Label BB";
      label->Visible=true;
   }

   {
      Label^ label=gcnew Label();
      label->Parent=stackPanelA;
      label->Text="Label AB";
      label->Visible=true;
   }

   Window^ window=gcnew Window();
   window->Size=int2(800,600);
   window->Client=stackPanelA;
        window->Visible=true;
   
//-- lazy   
    while(dynamic_cast<NativeWindow^>(window->NativeControl)->Created)
    {
      application->pump();
    }
   
   return 0;
}