Beispiel #1
0
MyParentWin::MyParentWin()
{
  sVSplitFrame *v;
  sToolBorder *tb;

  for(sInt i=0;i<4;i++)
  {
    v = new sVSplitFrame;
    for(sInt j=0;j<4;j++)
    {
      sWindow *w;
      if(i==2 && j==2)
      {
        sTextWindow *t = new sTextWindow;
        t->SetText(&Text);
        Text.PrintF(L"lk jsalk dsf fasd fdsfdkl asjd\n123456789\nabcdefghijklmnop\nnlhdlhefhdsjf hdkfh sldjhf");
        t->TextFlags |= sF2P_MULTILINE;
        w = t;
      }
      else
      {
        w = new MyWindow;
      }
      w->AddBorder(new sFocusBorder);
      v->AddChild(w);
    }
    v->AddBorder(new sFocusBorder);
    AddChild(v);
  }
  tb = new sToolBorder;
  tb->AddMenu(L"File",sMessage(this,&MyParentWin::MakeMenu));
  tb->AddMenu(L"View",sMessage());
  AddBorder(tb);
}
Beispiel #2
0
void ControlsFactory::CustomizeButton(UIButton *btn, const WideString &buttonText, bool designers)
{
    Font *font = GetFontLight();
    
    btn->SetStateDrawType(UIControl::STATE_NORMAL, UIControlBackground::DRAW_FILL);
    btn->SetStateDrawType(UIControl::STATE_PRESSED_INSIDE, UIControlBackground::DRAW_FILL);
    btn->SetStateDrawType(UIControl::STATE_DISABLED, UIControlBackground::DRAW_FILL);
    btn->SetStateDrawType(UIControl::STATE_SELECTED, UIControlBackground::DRAW_FILL);
    
    if(designers)
    {
        btn->GetStateBackground(UIControl::STATE_NORMAL)->SetColor(Color(97.f / 255.f, 69.f / 255.f, 68.f / 255.f, 1.f));
    }
    else 
    {
        btn->GetStateBackground(UIControl::STATE_NORMAL)->SetColor(Color(0.0f, 0.0f, 0.0f, 0.5f));
    }
    btn->GetStateBackground(UIControl::STATE_PRESSED_INSIDE)->SetColor(Color(0.5f, 0.5f, 0.5f, 0.5f));
    btn->GetStateBackground(UIControl::STATE_DISABLED)->SetColor(Color(0.2f, 0.2f, 0.2f, 0.2f));
    btn->GetStateBackground(UIControl::STATE_SELECTED)->SetColor(Color(0.0f, 0.0f, 1.0f, 0.2f));
    
    btn->SetStateFont(UIControl::STATE_PRESSED_INSIDE, font);
    btn->SetStateFont(UIControl::STATE_DISABLED, font);
    btn->SetStateFont(UIControl::STATE_NORMAL, font);
    btn->SetStateFont(UIControl::STATE_SELECTED, font);
    
    btn->SetStateText(UIControl::STATE_PRESSED_INSIDE, buttonText);
    btn->SetStateText(UIControl::STATE_DISABLED, buttonText);
    btn->SetStateText(UIControl::STATE_NORMAL, buttonText);
    btn->SetStateText(UIControl::STATE_SELECTED, buttonText);
    
    AddBorder(btn);
}
Beispiel #3
0
void ControlsFactory::CustomizePanelControl(UIControl *c, bool addBorder)
{
    c->GetBackground()->color = Color(0.4f, 0.4f, 0.4f, 1.0f);
    c->GetBackground()->SetDrawType(UIControlBackground::DRAW_FILL);
    
    if(addBorder)
    {
        AddBorder(c);
    }
}
Beispiel #4
0
WndForm::WndForm(SingleWindow &main_window, const DialogLook &_look,
                 const PixelRect &rc,
                 const TCHAR *Caption,
                 const WindowStyle style)
  :look(_look),
   modal_result(0), force(false),
   modeless(false),
   dragging(false),
   client_area(_look)
{
  Create(main_window, rc, Caption, AddBorder(style));
}
Beispiel #5
0
void
WndForm::Create(SingleWindow &main_window, const PixelRect &rc,
                const TCHAR *_caption, const WindowStyle style)
{
  if (_caption != nullptr)
    caption = _caption;
  else
    caption.clear();

  ContainerWindow::Create(main_window, rc, AddBorder(style));

#if defined(USE_WINUSER) && !defined(NDEBUG)
  ::SetWindowText(hWnd, caption.c_str());
#endif
}
Beispiel #6
0
void ControlsFactory::CustomizeCloseWindowButton(UIButton *btn)
{
    Font *font = GetFontDark();
    
    btn->SetStateDrawType(UIControl::STATE_NORMAL, UIControlBackground::DRAW_FILL);
    btn->SetStateDrawType(UIControl::STATE_PRESSED_INSIDE, UIControlBackground::DRAW_FILL);
    
    btn->GetStateBackground(UIControl::STATE_NORMAL)->SetColor(Color(1.0f, 0.0f, 0.0f, 0.5f));
    btn->GetStateBackground(UIControl::STATE_PRESSED_INSIDE)->SetColor(Color(0.8f, 0.0f, 0.0f, 0.5f));
    
    btn->SetStateFont(UIControl::STATE_PRESSED_INSIDE, font);
    btn->SetStateFont(UIControl::STATE_DISABLED, font);
    btn->SetStateFont(UIControl::STATE_NORMAL, font);
    btn->SetStateFont(UIControl::STATE_SELECTED, font);
    
    btn->SetStateText(UIControl::STATE_PRESSED_INSIDE, L"X");
    btn->SetStateText(UIControl::STATE_DISABLED, L"X");
    btn->SetStateText(UIControl::STATE_NORMAL, L"X");
    btn->SetStateText(UIControl::STATE_SELECTED, L"X");

    AddBorder(btn);
}
Beispiel #7
0
		PluginDialogBuilder(const PluginStartupInfo &aInfo, const GUID &aPluginId, const GUID &aId, const wchar_t *TitleMessage, const wchar_t *aHelpTopic, FARWINDOWPROC aDlgProc=nullptr, void* aUserParam=nullptr, FARDIALOGFLAGS aFlags = FDLG_NONE)
			: Info(aInfo), DialogHandle(nullptr), HelpTopic(aHelpTopic), PluginId(aPluginId), Id(aId), DlgProc(aDlgProc), UserParam(aUserParam), Flags(aFlags)
		{
			AddBorder(TitleMessage);
		}
Beispiel #8
0
sSystemInfoWindow::sSystemInfoWindow()
{
  AddBorder(new sFocusBorder);
}
Beispiel #9
0
DialogBuilder::DialogBuilder()
{
	AddBorder(L"");
}
Beispiel #10
0
DialogBuilder::DialogBuilder(const lng TitleMessageId, const string_view HelpTopic, const Dialog::dialog_handler handler):
	m_HelpTopic(HelpTopic),
	m_handler(std::move(handler))
{
	AddBorder(GetLangString(TitleMessageId));
}
Beispiel #11
0
DialogBuilder::DialogBuilder(int TitleMessageId, const wchar_t *HelpTopic):
	HelpTopic(HelpTopic)
{
	AddBorder(GetLangString(TitleMessageId));
}
Beispiel #12
0
		PluginDialogBuilder(const PluginStartupInfo &aInfo, const GUID &aPluginId, const GUID &aId, const wchar_t *TitleMessage, const wchar_t *aHelpTopic, FARWINDOWPROC aDlgProc=nullptr, void* aUserParam=nullptr)
			: Info(aInfo), HelpTopic(aHelpTopic), PluginId(aPluginId), Id(aId), DlgProc(aDlgProc), UserParam(aUserParam)
		{
			AddBorder(TitleMessage);
		}
Beispiel #13
0
ViewBitmapWin_::ViewBitmapWin_()
{
  Flags |= sGWF_PAINT3D;

  ShowOp = 0;

  FullSize = 0;

  ShowSizeX = 4;
  ShowSizeY = 4;
#if VARIANT==VARIANT_TEXTURE
  ShowVariant = 0;
#else
  ShowVariant = 2;
#endif

  BitmapX = 10;
  BitmapY = 10;
  BitmapTile = 0;
  BitmapAlpha = 0;
  BitmapZoom = 5;

  MtrlEnv.Init();
  MtrlEnv.Orthogonal = sMEO_PIXELS;

  MtrlTex = new sMaterial11;
  MtrlTex->ShaderLevel = sPS_00;
  MtrlTex->SetTex(0,0);
  MtrlTex->TFlags[0] = 0;
  MtrlTex->Combiner[sMCS_TEX0] = sMCOA_SET;
  MtrlTex->BaseFlags = sMBF_NONORMAL;
  MtrlTex->Compile();

  MtrlTexAlpha = new sMaterial11;
  MtrlTexAlpha->CopyFrom(MtrlTex);
  MtrlTexAlpha->BaseFlags |= sMBF_BLENDALPHA;
  MtrlTexAlpha->AlphaCombiner = sMCA_TEX0;
  MtrlTexAlpha->Compile();

  if(sSystem->GetShaderLevel()<sPS_11)
  {
    MtrlNormal = new sMaterial11;
    MtrlNormal->CopyFrom(MtrlTex);
    MtrlNormalLight = new sMaterial11;
    MtrlNormalLight->CopyFrom(MtrlTex);
  }
  else
  {
    MtrlNormal = new sMaterial11;
    MtrlNormal->CopyFrom(MtrlTex);
    MtrlNormal->ShaderLevel = sPS_11;
    MtrlNormal->Combiner[sMCS_COLOR0] = sMCOA_SET;
    MtrlNormal->Combiner[sMCS_TEX0] = sMCOA_MUL;
    MtrlNormal->Combiner[sMCS_COLOR2] = sMCOA_ADD;
    MtrlNormal->Color[0] = 0x00808080;
    MtrlNormal->Color[2] = 0x00808080;
    MtrlNormal->BaseFlags = sMBF_NONORMAL;
    MtrlNormal->Compile();

    MtrlNormalLight = new sMaterial11;
    MtrlNormalLight->ShaderLevel = sPS_11;
    MtrlNormalLight->BaseFlags = sMBF_ZOFF;
    MtrlNormalLight->LightFlags = sMLF_BUMPX;
    MtrlNormalLight->SpecPower = 24.0f;
    MtrlNormalLight->Combiner[sMCS_LIGHT] = sMCOA_SET;
    MtrlNormalLight->Combiner[sMCS_COLOR0] = sMCOA_MUL;
    MtrlNormalLight->Color[0] = 0x80c0c0c0;
    MtrlNormalLight->SetTex(1,0);
    MtrlNormalLight->TFlags[1] = 0;
    MtrlNormalLight->Compile();
  }

  {
    static sGuiMenuList ml[] = 
    {
      { sGML_COMMAND  ,'r'      ,CMD_VIEWBMP_RESET  ,0,"Reset" },
      { sGML_SPACER },
      { sGML_CHECKMARK,'t'      ,CMD_VIEWBMP_TILE      ,sOFFSET(ViewBitmapWin_,BitmapTile) ,"Tile"  },
      { sGML_CHECKMARK,'a'      ,CMD_VIEWBMP_ALPHA     ,sOFFSET(ViewBitmapWin_,BitmapAlpha),"Alpha" },
      { sGML_CHECKMARK,sKEY_TAB ,CMD_VIEWBMP_FULLSIZE  ,sOFFSET(ViewBitmapWin_,FullSize)   ,"Full size" },

      { 0 },
    };
    SetMenuList(ml);
  }

  Tools = new sToolBorder;
  Tools->AddLabel(".preview bitmap");
  Tools->AddContextMenu(CMD_VIEWBMP_POPUP);

  sControl *con;
  
  con = new sControl;
  con->EditChoice(0,&ShowSizeX,0,"16|32|64|128|256|512|1024|2048");
  con->Style &=~ sCS_FATBORDER;
  con->Style |= sCS_NOBORDER|sCS_SMALLWIDTH|sCS_DONTCLEARBACK|sCS_FAT;
  Tools->AddChild(con);

  con = new sControl;
  con->EditChoice(0,&ShowSizeY,0,"16|32|64|128|256|512|1024|2048");
  con->Style &=~ sCS_FATBORDER;
  con->Style |= sCS_NOBORDER|sCS_SMALLWIDTH|sCS_DONTCLEARBACK|sCS_FAT;
  Tools->AddChild(con);

  con = new sControl;
  con->EditChoice(0,&ShowVariant,0,"16C|16I|8C|8I");
  con->Style &=~ sCS_FATBORDER;
  con->Style |= sCS_NOBORDER|sCS_SMALLWIDTH|sCS_DONTCLEARBACK|sCS_FAT;
  Tools->AddChild(con);

  AddBorder(Tools);
}
Beispiel #14
0
DialogBuilder::DialogBuilder():
	m_HelpTopic(L""),  m_Mode(0), m_IdExist(false)
{
	AddBorder(L"");
}
Beispiel #15
0
DialogBuilder::DialogBuilder(LNGID TitleMessageId, const wchar_t *HelpTopic, Dialog::dialog_handler handler):
	m_HelpTopic(NullToEmpty(HelpTopic)), m_Mode(0), m_IdExist(false), m_handler(handler)
{
	AddBorder(DialogBuilder::GetLangString(TitleMessageId));
}
Beispiel #16
0
DialogBuilder::DialogBuilder():
	HelpTopic(L""),  Mode(0), IdExist(false)
{
	AddBorder(L"");
}