public CheckBox(BaseControl owner)
     : base(owner)
 {
     Group  = 0;
     fImage = NWResourceManager.LoadImage(MainWindow.Screen, "itf/Check.tga", Colors.None);
     Height = 20;
 }
Beispiel #2
0
        public int AddImage(string fileName, int transColor, bool transDefault)
        {
            try {
                BaseImage img = NWResourceManager.LoadImage(fScreen, fileName, transColor);
                if (img != null)
                {
                    if (transDefault)
                    {
                        img.SetTransDefault();
                    }

                    int result = fImages.Count;
                    fImages.Add(img);

                    return(result);
                }
                else
                {
                    return(-1);
                }
            } catch (Exception ex) {
                Logger.Write("ImageList.addImage(" + fileName + "): " + ex.Message);
                return(-1);
            }
        }
        public MapWindow(BaseControl owner) : base(owner)
        {
            Font        = CtlCommon.SmFont;
            Width       = 656;
            Height      = 496;
            WindowStyle = new WindowStyles(WindowStyles.wsScreenCenter, WindowStyles.wsModal, WindowStyles.wsKeyPreview);
            BackDraw    = false;
            Shifted     = false;

            fImage   = NWResourceManager.LoadImage(MainWindow.Screen, "itf/MapBack.tga", Colors.None);
            fMapHint = "";
        }
Beispiel #4
0
        public HeroWindow(BaseControl owner)
            : base(owner)
        {
            Font        = CtlCommon.SmFont;
            Width       = 590;
            Height      = 430;
            WindowStyle = new WindowStyles(WindowStyles.wsScreenCenter, WindowStyles.wsModal, WindowStyles.wsKeyPreview);

            fImages = new BaseImage[6];
            for (int pa = (int)SysCreature.sc_First; pa <= (int)SysCreature.sc_Last; pa++)
            {
                SysCreatureRec sc = StaticData.dbSysCreatures[pa];

                fImages[pa] = NWResourceManager.LoadImage(MainWindow.Screen, "itf/pa_" + sc.Sign + ".tga", Colors.None);
            }

            fEditBox         = new EditBox(this);
            fEditBox.Left    = (Width - 200) / 2;
            fEditBox.Top     = 35;
            fEditBox.Width   = 200;
            fEditBox.Visible = true;
        }
Beispiel #5
0
        public ScrollBar(BaseControl owner)
            : base(owner)
        {
            ControlStyle.Include(ControlStyles.сsCaptureMouse);
            fKind = SBK_VERTICAL;
            fOldThumbX = -1;
            fOldThumbY = -1;
            fOldThumbPos = -1;
            fMin = 0;
            fMax = 100;
            fPos = 0;
            ThumbHeight = 17;
            ThumbWidth = 17;
            ArrowHeight = 17;
            ArrowWidth = 17;
            BaseScreen scr = MainWindow.Screen;

            fThumb = NWResourceManager.LoadImage(scr, "itf/SBThumb.tga", Colors.None);
            fHBack = NWResourceManager.LoadImage(scr, "itf/SBHBack.tga", Colors.None);
            fHArrows = NWResourceManager.LoadImage(scr, "itf/SBHArrow.tga", Colors.None);
            fVBack = NWResourceManager.LoadImage(scr, "itf/SBVBack.tga", Colors.None);
            fVArrows = NWResourceManager.LoadImage(scr, "itf/SBVArrow.tga", Colors.None);
        }
        public ListBox(BaseControl owner)
            : base(owner)
        {
            fMode                  = MODE_LIST;
            fColumnTitles          = new LBColumnTitles();
            fColumnTitles.OnChange = OnChange;
            fItems                 = new LBItemList(this, null);
            fItems.OnChange        = OnChange;
            fColumns               = 1;
            fTopIndex              = 0;
            fSelIndex              = 0;
            Options                = new LBOptions();

            ScrollBar          = new ScrollBar(this);
            ScrollBar.Min      = 0;
            ScrollBar.Max      = 100;
            ScrollBar.Pos      = 0;
            ScrollBar.OnChange = OnScroll;
            ScrollBar.Left     = Width - ScrollBar.Width;
            ScrollBar.Top      = 0;
            ScrollBar.Height   = 104;

            SelColor       = Colors.Gray;
            SelBorderColor = Colors.Gray;
            Height         = 100;
            Width          = 200;
            ItemHeight     = Font.Height + 2;
            BaseScreen scr = MainWindow.Screen;

            CheckImage  = NWResourceManager.LoadImage(scr, "itf/Check.tga", Colors.None);
            CheckHeight = (int)((int)CheckImage.Height / 3);
            CheckWidth  = (int)CheckImage.Width;

            TVBtn       = NWResourceManager.LoadImage(scr, "itf/TVBtn.tga", Colors.Black);
            LevelOffset = (int)TVBtn.Width;
        }
Beispiel #7
0
        public MenuWindow(BaseControl owner)
            : base(owner)
        {
            fSplash = NWResourceManager.LoadImage(MainWindow.Screen, "itf/Splash.tga", Colors.None);

            int offset = 110;

            Width       = 204;
            Height      = 270 + offset;
            WindowStyle = new WindowStyles(WindowStyles.wsScreenCenter, WindowStyles.wsModal, WindowStyles.wsKeyPreview);

            NWButton tRButton = new NWButton(this);

            tRButton.Left         = 20;
            tRButton.Top          = offset + 20;
            tRButton.Width        = 164;
            tRButton.Height       = 30;
            tRButton.ImageFile    = "itf/MenuBtn.tga";
            tRButton.OnClick      = OnBtnClose;
            tRButton.OnLangChange = GlobalVars.nwrWin.LangChange;
            tRButton.LangResID    = 7;

            NWButton tRButton2 = new NWButton(this);

            tRButton2.Left         = 20;
            tRButton2.Top          = offset + 60;
            tRButton2.Width        = 164;
            tRButton2.Height       = 30;
            tRButton2.ImageFile    = "itf/MenuBtn.tga";
            tRButton2.OnClick      = OnBtnNew;
            tRButton2.OnLangChange = GlobalVars.nwrWin.LangChange;
            tRButton2.LangResID    = 1;

            NWButton tRButton3 = new NWButton(this);

            tRButton3.Left         = 20;
            tRButton3.Top          = offset + 100;
            tRButton3.Width        = 164;
            tRButton3.Height       = 30;
            tRButton3.ImageFile    = "itf/MenuBtn.tga";
            tRButton3.OnClick      = OnBtnLoad;
            tRButton3.OnLangChange = GlobalVars.nwrWin.LangChange;
            tRButton3.LangResID    = 2;

            NWButton tRButton4 = new NWButton(this);

            tRButton4.Left         = 20;
            tRButton4.Top          = offset + 140;
            tRButton4.Width        = 164;
            tRButton4.Height       = 30;
            tRButton4.ImageFile    = "itf/MenuBtn.tga";
            tRButton4.OnClick      = OnBtnSave;
            tRButton4.OnLangChange = GlobalVars.nwrWin.LangChange;
            tRButton4.LangResID    = 3;

            NWButton tRButton5 = new NWButton(this);

            tRButton5.Left         = 20;
            tRButton5.Top          = offset + 180;
            tRButton5.Width        = 164;
            tRButton5.Height       = 30;
            tRButton5.ImageFile    = "itf/MenuBtn.tga";
            tRButton5.OnClick      = OnBtnOptions;
            tRButton5.OnLangChange = GlobalVars.nwrWin.LangChange;
            tRButton5.LangResID    = 5;

            NWButton tRButton6 = new NWButton(this);

            tRButton6.Left         = 20;
            tRButton6.Top          = offset + 220;
            tRButton6.Width        = 164;
            tRButton6.Height       = 30;
            tRButton6.ImageFile    = "itf/MenuBtn.tga";
            tRButton6.OnClick      = OnBtnExit;
            tRButton6.OnLangChange = GlobalVars.nwrWin.LangChange;
            tRButton6.LangResID    = 6;
        }
 public static void InitCtlImages(BaseScreen screen)
 {
     CtlDecor = NWResourceManager.LoadImage(screen, "itf/ctl_decor.tga", Colors.White);
     WinBack  = NWResourceManager.LoadImage(screen, "itf/back.tga", Colors.None);
     WinDecor = NWResourceManager.LoadImage(screen, "itf/win_decor.tga", Colors.White);
 }