Esempio n. 1
0
static void Initialize(void)
{
     Controls[0] = CreateLabel("You have pressed the key to stop the",
                               DIALOGFORCOLOR, DIALOGBACKCOLOR,
                               TEXT_X, DIALOG_Y+1);

     Controls[1] = CreateLabel("defragmentation process.",
                               DIALOGFORCOLOR, DIALOGBACKCOLOR,
                               TEXT_X, DIALOG_Y+2);

                               
     Controls[2] = CreateLabel("Are you sure you want to stop?",
                               DIALOGFORCOLOR, DIALOGBACKCOLOR,
                               TEXT_X, DIALOG_Y+4);
     

     Controls[3] = CreateCommandButton(&YesButton,
                                       BUTTONFORCOLOR, BUTTONBACKCOLOR,
                                       BUTTON_X1, BUTTON_Y, TRUE, FALSE,
                                       FALSE);
     
     Controls[4] = CreateCommandButton(&NoButton,
                                       BUTTONFORCOLOR, BUTTONBACKCOLOR,
                                       BUTTON_X2, BUTTON_Y, FALSE, TRUE, 
                                       FALSE);
}
void ToolsOptionsWindow::CreateGeneralPanel ()
{
	m_pfoldersframe = CreateGroupBox ("Protected Folders", 130, 15, 390, 103, ID_LBLSTATIC);
	
	m_pfoldersinfo1 = CreateLabel ("When my computer starts up / wakes up:", 140, 35, 300, 20, ID_LBLSTATIC);
	m_pfolderspromptpowerup = CreateCheckBox ("Ask me before Decrypting protected folders", 155, 53, 300, 20, ID_CHKPFOLDERPROMPTPUP);
	m_pfoldersinfo2 = CreateLabel ("When my computer shuts down / sleeps:", 140, 75, 300, 20, ID_LBLSTATIC);
	m_pfolderspromptpowerdown = CreateCheckBox ("Ask me before Encrypting protected folders", 155, 92, 300, 20, ID_CHKPFOLDERPROMPTPDN);

	m_ptextencframe = CreateGroupBox ("Universal Text Encryption", 130, 130, 390, 120, ID_LBLSTATIC);
	
	m_lblenc = CreateLabel ("Encrypt Hotkey", 170, 164, 100, 20, ID_LBLSTATIC);
	m_chkencctrl = CreateCheckBox ("Ctrl", 280, 163, 40, 20, ID_UTEBTNHOTENCCTRL);
	m_chkencalt = CreateCheckBox ("Alt", 340, 163, 40, 20, ID_UTEBTNHOTENCALT);
	m_txtenckey = CreateTextBox (400, 163, 40, 20, ID_UTETXTHOTENC);

	m_lbldec = CreateLabel ("Decrypt Hotkey", 170, 194, 100, 20, ID_LBLSTATIC);
	m_chkdecctrl = CreateCheckBox ("Ctrl", 280, 193, 40, 20, ID_UTEBTNHOTDECCTRL);
	m_chkdecalt = CreateCheckBox ("Alt", 340, 193, 40, 20, ID_UTEBTNHOTDECALT);
	m_txtdeckey = CreateTextBox (400, 193, 40, 20, ID_UTETXTHOTDEC);

	m_lblinfo = CreateLabel ("NOTE: Hot Key settings will take effect after next reboot.", 170, 227, 300, 20, ID_LBLSTATIC);

	m_autoupdateframe = CreateGroupBox ("Automatic Updates", 130, 265, 390, 103, ID_LBLSTATIC);
	m_chkautoupdate = CreateCheckBox ("Automatically check online for a newer version of CedeCrypt", 155, 310, 300, 20, ID_CHKAUTOUPDATECHECK);

	ShowWindow (m_chkencalt, SW_HIDE);
	ShowWindow (m_chkdecalt, SW_HIDE);
}
Esempio n. 3
0
void CGlobalSettingWindow::OnCreate(HWND parent, int xPos, int yPos, int width, int height)
{
	CSubWindow::OnCreate(parent, xPos, yPos, width, height);
	HINSTANCE hInst = GetModuleHandle(NULL);

	mSaveBtn = CreateControl(TEXT("button"), TEXT("Save"),
		WS_CHILD | WS_VISIBLE, 10, 5, 70, 24,
		(IDC_SAVE_SCENE_BTN), NULL);

	HWND label1 = CreateLabel(IDC_GLOBAL_LABEL, TEXT("Ambient:"), 90, 5, 60);
	HWND label2 = CreateLabel(IDC_GLOBAL_LABEL + 1, TEXT("Diffuse:"), 210, 5, 60);
	HWND label3 = CreateLabel(IDC_GLOBAL_LABEL + 2, TEXT("Specular:"), 330, 5, 60);

	mAmbientTextField = CreateControl(TEXT("edit"), NULL, WS_CHILDWINDOW | WS_VISIBLE | WS_BORDER,
		150, 5, 60, 20, IDC_SCENE_AMBIENT_TEXTFIELD, NULL);

	mDiffuseTextField = CreateControl(TEXT("edit"), NULL, WS_CHILDWINDOW | WS_VISIBLE | WS_BORDER,
		270, 5, 60, 20, IDC_SCENE_DIFFUSE_TEXTFIELD, NULL);

	mSpecularTextField = CreateControl(TEXT("edit"), NULL, WS_CHILDWINDOW | WS_VISIBLE | WS_BORDER,
		390, 5, 60, 20, IDC_SCENE_SPECULAR_TEXTFIELD, NULL);

	mUpdateBtn = CreateControl(TEXT("button"), TEXT("Update"),
		WS_CHILD | WS_VISIBLE, 450, 5, 60, 22, IDC_SCENE_UPDATE_BTN, NULL);

	mDeferShadingCheckBox = CreateControl(TEXT("button"), TEXT("Deferred Shading"),
		WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
		5, 30, 150, 20, IDC_DEFER_SHADING_CHECKBOX, NULL);

	mAntiAliasingCheckBox = CreateControl(TEXT("button"), TEXT("Anti-Aliasing"),
		WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
		160, 30, 150, 20, IDC_ANTI_ALIASING_CHECKBOX, NULL);
}
void umlBiDirectAssocItem::Initialize()
{
    // initialize shape	

	AcceptConnection(wxT("uddNoteConnItem"));
    AcceptSrcNeighbour(wxT("All"));
    AcceptTrgNeighbour(wxT("All"));

	m_Pen = *wxBLACK_PEN;
	
	// create labels
	SetMaxLabelCount( 4 );
	
	uddLabelElement *pLabel = CreateLabel( udLABEL::ltASSOC_MULT1 );
	if( pLabel )
	{
		pLabel->SetText( wxT("*") );
		pLabel->SetCustomDockPoint(sfdvLINESHAPE_DOCKPOINT_START);
		pLabel->SetRelativePosition(0, -15);
		pLabel->SetHAlign( halignLINE_START );
		pLabel->SetHBorder( 10 );
		pLabel->RemoveStyle( sfsPOSITION_CHANGE );
	}

	pLabel = CreateLabel( udLABEL::ltASSOC_ROLE1 );
	if( pLabel )
	{
		pLabel->SetText( wxT("role 1") );
		pLabel->SetCustomDockPoint(sfdvLINESHAPE_DOCKPOINT_START);
		pLabel->SetRelativePosition(0, 5);
		pLabel->SetHAlign( halignLINE_START );
		pLabel->SetHBorder( 10 );
		pLabel->RemoveStyle( sfsPOSITION_CHANGE );
	}
	
	pLabel = CreateLabel( udLABEL::ltASSOC_MULT2 );
	if( pLabel )
	{
		pLabel->SetText( wxT("*") );
		pLabel->SetCustomDockPoint(sfdvLINESHAPE_DOCKPOINT_END);
		pLabel->SetRelativePosition(0, -15);
		pLabel->SetHAlign( halignLINE_END );
		pLabel->SetHBorder( 10 );
		pLabel->RemoveStyle( sfsPOSITION_CHANGE );
	}
	
	pLabel = CreateLabel( udLABEL::ltASSOC_ROLE2 );
	if( pLabel )
	{
		pLabel->SetText( wxT("role 2") );
		pLabel->SetCustomDockPoint(sfdvLINESHAPE_DOCKPOINT_END);
		pLabel->SetRelativePosition(0, 5);
		pLabel->SetHAlign( halignLINE_END );
		pLabel->SetHBorder( 10 );
		pLabel->RemoveStyle( sfsPOSITION_CHANGE );
	}
}
Esempio n. 5
0
// -----------------------------------------------------------------------
// Initialize splash window
void CALLBACK FrmSplashInitProc(HWND hWnd)
{
    CreatePictureBox(0, 0, 500, 194, hWnd,
                     LoadBitmap(ApphInstance,
                     MAKEINTRESOURCE(MBMP_BASE + MBMP_TITLE)),
                     IMAGE_BITMAP, 0, 0, SS_CENTERIMAGE);
    //441
    FRMSplashVersionLabel = CreateLabel(436, 198, 58, 16, hWnd, "", 2, &FrmSplashLabelVersionHook, 0, 0);
    FRMSplashStatusLabel = CreateLabel(6, 198, 264, 16, hWnd, "", 3, &FrmSplashLabelInfoHook, 0, 0);
    FrmSplashSetState("");
    hBandBrush = GDICreateColorBrush(SPLASH_BANDCOLOR);
    CursorSetWait();
}
Esempio n. 6
0
void CNodeInfoWindow::OnCreate(HWND parent, int xPos, int yPos, int width, int height)
{
	CSubWindow::OnCreate(parent, xPos, yPos, width, height);

	HINSTANCE hInst = GetModuleHandle(NULL);

	HWND label1 = CreateLabel(IDC_NODE_INFO_LABEL, TEXT("T:"), 0, 10, 20);
	HWND label2 = CreateLabel(IDC_NODE_INFO_LABEL + 1, TEXT("R:"), 0, 40, 20);
	HWND label3 = CreateLabel(IDC_NODE_INFO_LABEL + 2, TEXT("S:"), 0, 70, 20);
	
	const int textFieldWidth = 90;
	const int intervalBetweenTextFields = 2;

	for (u32 i = 0; i < 3; i++)
	{
		mPosTextFields[i] = CreateControl(TEXT("edit"), NULL, WS_CHILDWINDOW | WS_VISIBLE | WS_BORDER,
			20 + i * (textFieldWidth + intervalBetweenTextFields), 10, textFieldWidth, 20, 
			(IDC_POS_TEXTFIELD + i), NULL);

		mRotTextFields[i] = CreateControl(TEXT("edit"), NULL, WS_CHILDWINDOW | WS_VISIBLE | WS_BORDER,
			20 + i * (textFieldWidth + intervalBetweenTextFields), yPos + 40, textFieldWidth, 20,
			(IDC_ROT_TEXTFIELD + i), NULL);

		mScaleTextFields[i] = CreateControl(TEXT("edit"), NULL, WS_CHILDWINDOW | WS_VISIBLE | WS_BORDER,
			20 + i * (textFieldWidth + intervalBetweenTextFields), yPos + 70, textFieldWidth, 20,
			(IDC_SCALE_TEXTFIELD + i), NULL);
	}

	mUpdateTransformBtn = CreateControl(TEXT("button"), TEXT("Update"),
		WS_CHILD | WS_VISIBLE, 10, 100, 100, 24,
		(IDC_UPDATE_TRANSFORM_BTN), NULL);

	mCancelTransformBtn = CreateControl(TEXT("button"), TEXT("Cancel"),
		WS_CHILD | WS_VISIBLE, 115, 100, 100, 24,
		 (IDC_CANCEL_TRANSFORM_BTN), NULL);

	mStaticCheckBox = CreateControl(TEXT("button"), TEXT("Static"),
		WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
		10, 130, 60, 20, IDC_NODE_INFO_STATIC_CHECKBOX, NULL);

	mPhysicsCheckBox = CreateControl(TEXT("button"), TEXT("Bounding Physics"),
		WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
		80, 130, 150, 20, IDC_NODE_INFO_PHYSICS_CHECKBOX, NULL);

	mShadowCheckBox = CreateControl(TEXT("button"), TEXT("Shadow"),
		WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
		10, 150, 70, 30, IDC_NODE_INFO_SHADOW_CHECKBOX, NULL);
}
Esempio n. 7
0
const Entity EntityBuilder::CreateSlider(const XMFLOAT3& pos, float width, float height, float minv, float maxv, float defval, float size1, bool real, const std::string& text, float fontSize, float size2, std::function<void()> change, const  XMFLOAT4& textColor)
{
	Slider* s = nullptr;
	try { s = new Slider(minv,maxv,width, height,defval, real, std::move(change)); }
	catch (std::exception& e) { e;SAFE_DELETE(s); throw ErrorMsg(1500003, L"Could not create slider"); }

	Entity ent = _entity.Create();
	_transform->CreateTransform(ent);
	Entity rail = CreateImage(XMFLOAT3(size2, height / 2.0f - height / 16.0f, 0.0f), width+ height / 4.0f, height / 8.0f, "Assets/Textures/Light_Bar.png");
	Entity slidebar = CreateImage(XMFLOAT3(size2+width*((defval-minv)/(maxv-minv)), height/2.0f- height/4.0f, 0.0f), height / 2.0f, height / 2.0f, "Assets/Textures/Slide_Bar.png");
	Entity la = CreateLabel(XMFLOAT3(0.0f,0.0f,0.0f), text, fontSize, textColor, size2, height, "");
	Entity vtext = CreateLabel(XMFLOAT3(width + size2 + height / 2.0f, 0.0f, 0.0f), (real) ? to_string((double)defval) : to_string((int)defval), fontSize, textColor, size1, height, "");
	
	_transform->BindChild(ent, slidebar);
	_transform->BindChild(ent, la);
	_transform->BindChild(ent, vtext);
	_transform->BindChild(ent, rail);

	_transform->SetPosition(ent, pos);

	_controller->AddSlider(ent, s);

	auto i = System::GetInput();
	_event->BindEvent(slidebar, EventManager::EventType::Drag,
		[s,this, slidebar,i,size2,vtext]() 
	{
		int x, y;
		i->GetMouseDiff(x, y);
		float currp = s->width*((s->curr - s->minv) / (s->maxv - s->minv));
		currp += x;
		s->curr = (currp / s->width)*(s->maxv - s->minv) + s->minv;
		if (s->curr >= s->maxv)
			s->curr = s->maxv;
		else if (s->curr <= s->minv)
			s->curr = s->minv;
		else
		{
			this->_transform->SetPosition(slidebar, XMFLOAT3(size2 + currp, s->height / 2.0f - s->height / 4.0f, 0.0f));
			
			
		}
		s->change();
		this->_text->ChangeText(vtext, (s->real) ? to_string((double)s->curr) : to_string((int)s->curr));
	});

	return ent;

}
Esempio n. 8
0
/* 翻译一个函数 */
static void TranslateFunction (AstFunction func)
{
	BBlock bb;

	FSYM = func->fsym;
	if (!FSYM->defined)
		return;

	TempNum = 0;
    /* 创建函数中间代码的开始结束 */
	FSYM->entryBB   = CreateBBlock ();
	FSYM->exitBB    = CreateBBlock ();

    /* 当前中间代码的入口点 */
	CurrentBB = FSYM->entryBB;
    /* 翻译函数体中的语句 */
	TranslateStatement (func->stmt);

    /* 函数结束 */
	StartBBlock (FSYM->exitBB);

    /* 中间代码优化 */
	Optimize (FSYM);

    static int i = 0;

    /* 给基本块创建名字 */
    for (bb = FSYM->entryBB; bb; bb = bb->next) {

		if (bb->ref != 0) {

			bb->sym = CreateLabel ();
		}
	}
}
Esempio n. 9
0
void create_points_frame(void *data)
{
    set_wait_cursor();
    
    if (points_frame == NULL) {
        Widget dialog, wbut, rc, fr;
        
	points_frame = CreateDialogForm(app_shell, "Point explorer");
	
	fr = CreateFrame(points_frame, NULL);
        AddDialogFormChild(points_frame, fr);
	locate_point_message = CreateLabel(fr, "Point explorer");
        
        dialog = CreateVContainer(points_frame);
        AddDialogFormChild(points_frame, dialog);

        track_set_sel = CreateSetChoice(dialog,
            "Restrict to set:", LIST_TYPE_SINGLE, TRUE);
        AddListChoiceCB(track_set_sel, track_set_cbproc, NULL);
        
	rc = CreateHContainer(dialog);
	goto_index_item = CreateTextItem(rc, 6, "Point location:");
	wbut = CreateButton(rc, "Goto point");
	AddButtonCB(wbut, do_gotopt_proc, NULL);

	locate_point_item = CreateTextInput(dialog, "Point data:");

	CreateSeparator(dialog);

	rc = CreateHContainer(dialog);

	wbut = CreateButton(rc, "Track");
	AddButtonCB(wbut, do_track_proc, NULL);

	wbut = CreateButton(rc, "Move");
	AddButtonCB(wbut, do_ptsmove_proc, (void *) MOVE_POINT_XY);
	wbut = CreateButton(rc, "Move X");
	AddButtonCB(wbut, do_ptsmove_proc,  (void *) MOVE_POINT_X);
	wbut = CreateButton(rc, "Move Y");
	AddButtonCB(wbut, do_ptsmove_proc,  (void *) MOVE_POINT_Y);

	wbut = CreateButton(rc, "Prepend");
	AddButtonCB(wbut, do_add_proc, (void *) ADD_POINT_BEGINNING);
	wbut = CreateButton(rc, "Append");
	AddButtonCB(wbut, do_add_proc, (void *) ADD_POINT_END);
	wbut = CreateButton(rc, "Insert");
	AddButtonCB(wbut, do_add_proc, (void *) ADD_POINT_NEAREST);

	wbut = CreateButton(rc, "Delete");
	AddButtonCB(wbut, do_del_proc, NULL);

	wbut = CreateButton(rc, "Close");
	AddButtonCB(wbut, points_done_proc, (void *) points_frame);
        
        ManageChild(points_frame);
    }
    
    RaiseWindow(GetParent(points_frame));
    unset_wait_cursor();
}
Esempio n. 10
0
static void Initialize(void)
{
    controls[0] = CreateLabel("Your drive has been optimized.",
                              DIALOGFORCOLOR, DIALOGBACKCOLOR,
                              FRAME_X, DIALOG_Y+1);

    controls[1] = CreateFrame(&ActionsFrame,
                              DIALOGFORCOLOR, DIALOGBACKCOLOR,
                              FRAME_X, DIALOG_Y+3);

    controls[2] = CreateSelectionButton(&SelectButtons[0],
                                        DIALOGFORCOLOR, DIALOGBACKCOLOR,
                                        TEXT_X, DIALOG_Y+4);

    controls[3] = CreateSelectionButton(&SelectButtons[1],
                                        DIALOGFORCOLOR, DIALOGBACKCOLOR,
                                        TEXT_X, DIALOG_Y+5);

    controls[4] = CreateSelectionButton(&SelectButtons[2],
                                        DIALOGFORCOLOR, DIALOGBACKCOLOR,
                                        TEXT_X, DIALOG_Y+6);

    controls[5] = CreateCommandButton(&OkButton,
                                      BUTTONFORCOLOR, BUTTONBACKCOLOR,
                                      BUTTON_X, BUTTON_Y, TRUE, FALSE,
                                      FALSE);
}
void ToolsOptionsWindow::CreateAlgorithmsPanel ()
{
	m_algframe = CreateGroupBox ("Encryption Algorithms", 130, 15, 390, 403, ID_LBLSTATIC);

	m_algimage.SetBitmapResources (IDB_ALGORITHMSIMAGE);
	m_algimage.SetBitmapProperties (0, 0, 345, 254);
	m_algimage.SetProperties (m_hwnd, CID_HEADER, 170, 75, 345, 254);
	m_uihandler.AddDirectControl (&m_algimage);

	/*

	#define ID_OPTALGCYBERCEDE				943
	#define ID_OPTALGAES256					944
	#define ID_OPTALG3DES					945
	#define ID_OPTALGDES					946
	ID_LBLCURRENTALG
	*/

	m_algoptcybercede = CreateRadioButton ("", 145, 95, 15, 15, ID_OPTALGCYBERCEDE);
	m_algoptaes256 = CreateRadioButton ("", 145, 160, 15, 15, ID_OPTALGAES256);
	m_algopt3des = CreateRadioButton ("", 145, 225, 15, 15, ID_OPTALG3DES);
	m_algoptdes = CreateRadioButton ("", 145, 290, 15, 15, ID_OPTALGDES);

	m_lblcurrentalg = CreateLabel ("Current Selected Algorithm: ", 173, 45, 290, 19, ID_LBLCURRENTALG);
}
Esempio n. 12
0
void LabelManager::CreateLabels()
{
    void *file = LCOpen(NULL);
    
    if (file)
    {
        TCHAR line[MAX_LINE_LENGTH];
        
        // Read all the *Tutorial lines from the configuration file
        while (LCReadNextConfig(file, "*Tutorial", line, MAX_LINE_LENGTH))
        {
            TCHAR key[MAX_LINE_LENGTH];
            TCHAR value[MAX_LINE_LENGTH];
            LPTSTR buffers[2];
            
            buffers[0] = key;
            buffers[1] = value;
            
            // LCReadNextConfig returns the entire line, so we have to parse it
            // to get the label name
            if (LCTokenize(line, buffers, 2, NULL) >= 2)
            {
                CreateLabel(value);
            }
        }
        
        LCClose(file);
    }
}
Esempio n. 13
0
const Entity EntityBuilder::CreateProgressBar(const XMFLOAT3 & position, const std::string & text, float fontSize, float textSize, const XMFLOAT4 & colorTex, const float min, const float max, const float start, float width, float height)
{
	ProgressBar* b = nullptr;
	try {
		b = new ProgressBar(start, min, max, width, height);
	}
	catch (std::exception& e) { e; throw ErrorMsg(0, L"Failed to create progress bar."); }
	Entity ent = CreateLabel(position, text, fontSize, colorTex, textSize, height, "");


	float l = width*((b->value - b->minV) / (b->maxV - b->minV));
	Entity bar = CreateOverlay(XMFLOAT3(textSize, 0.0f, 0.0f), l, height, "Assets/Textures/default_color.png");
	
	_transform->BindChild(ent, bar);

	_transform->SetPosition(ent, position);

	_animation->CreateAnimation(ent, "scale", 0.15f, 
		[bar,b,this](float delta, float amount, float offset) 
	{
		_overlay->SetExtents(bar, offset + amount, b->height);
	});


	_controller->AddProgressBar(ent, b);
	return ent;
}
Esempio n. 14
0
int CodeGenerator::GenDoStart()
{
   GenBlockHeader( "Do loop" );
   int newLabel = CreateLabel();
   GenLabel( newLabel );
   return newLabel;
}
Esempio n. 15
0
//Allocate a label and create it :).Will be deleted when calling free and/or destructor
x86_Label* x86_block::CreateLabel(bool mark,u32 sz)
{
	x86_Label* lbl = new x86_Label();
	CreateLabel(lbl,mark,sz);
	labels.push_back(lbl);
	return lbl;
}
Esempio n. 16
0
Jitter::CJitter::LABEL CMipsJitter::GetFinalBlockLabel()
{
	if(m_lastBlockLabel == -1)
	{
		m_lastBlockLabel = CreateLabel();
	}
	return m_lastBlockLabel;
}
Esempio n. 17
0
int CodeGenerator::GenWhileMiddle()
{
   int whileFinishLabel = CreateLabel();
   GenPop( "eax" );
   GenLine( "cmp eax, 0" );
   GenLine( "JE L" + toString( whileFinishLabel ) );
   return whileFinishLabel;
}
Esempio n. 18
0
void CCylinderBoundingWindow::OnCreate(HWND parent, 
	int xPos, int yPos, int width, int height)
{
	CSubWindow::OnCreate(parent, xPos, yPos, width, height);

	const int textFieldWidth = 90;
	const int labelWidth = 60;
	
	HWND label1 = CreateLabel(IDC_CYLINDER_LABELS, TEXT("Height:"), 0, 10, labelWidth);
	mHeightTextField = CreateControl(TEXT("edit"), NULL, WS_CHILDWINDOW | WS_VISIBLE | WS_BORDER,
		labelWidth, 10, textFieldWidth, 20,
		IDC_CYLINDER_HEIGHT_TEXTFIELD, NULL);

	HWND label2 = CreateLabel(IDC_CYLINDER_LABELS + 1, TEXT("Radius:"), 0, 40, labelWidth);
	mRadiusTextField = CreateControl(TEXT("edit"), NULL, WS_CHILDWINDOW | WS_VISIBLE | WS_BORDER,
		labelWidth, 40, textFieldWidth, 20,
		IDC_CYLINDER_RADIUS_TEXTFIELD, NULL);
}
Esempio n. 19
0
int CodeGenerator::GenIfStart()
{
   GenBlockHeader( "If statement" );
   GenPop( "eax" );
   GenLine( "cmp eax, 0" );
   int endIflabel = CreateLabel();
   GenLine( "JE L" + toString( endIflabel ) );
   return endIflabel;
}
Esempio n. 20
0
//---------------------------------------------------------------------
__fastcall TBookmarkFolderDialog::TBookmarkFolderDialog(TStrings * Folders) :
  TCustomDialog(HELP_LOCATION_PROFILE_MOVE)
{
  Caption = LoadStr(MOVE_BOOKMARK_CAPTION);

  NameCombo = new TComboBox(this);
  NameCombo->AutoComplete = false;
  AddComboBox(NameCombo, CreateLabel(LoadStr(MOVE_BOOKMARK_PROMPT)));
  NameCombo->Items = Folders;
}
Esempio n. 21
0
int RecommendMethod(int fragmentation, char drive, char* recommendation)
{
    char buffer[40];
    char* drv = "?";
    int   posx, control;

    static int Initialized = FALSE;

    if (!Initialized)
    {
       Initialize();
       Initialized = TRUE;
    }

    SetStatusBar(RED, WHITE, "                                            ");
    SetStatusBar(RED, WHITE, " Recommending defragmentation method.");

    itoa(fragmentation, buffer, 10);
    strcat(buffer, "% of drive ");
    drv[0] = drive;
    strcat(buffer, drv);
    strcat(buffer, ": is not fragmented.");

    controls[3] = CreateLabel(buffer,
                              DIALOGFORCOLOR, DIALOGBACKCOLOR,
                              TEXT_X, DIALOG_Y+2);

    posx = (DIALOG_X_LEN / 2) - (strlen(recommendation) / 2) + DIALOG_X; 
    
    controls[4] = CreateLabel(recommendation,
                              BLUE, DIALOGBACKCOLOR,
                              posx, DIALOG_Y+6);

    OpenWindow(&RecommendDialog);
    control = ControlWindow(&RecommendDialog);
    CloseWindow();

    if (control == OPTIMIZEBUTTON) 
       return TRUE;
    else
       return FALSE;
}
Esempio n. 22
0
void CLabelTestDlg::OnPaint()
{
	PAINTSTRUCT ps;
	BeginPaint(&ps);

	DrawPath();
	CreateLabel();
	DisplayPercentage();

	EndPaint(&ps);
}
Esempio n. 23
0
int CodeGenerator::GenFuncStart( std::string funcName )
{
   GenBlockHeader( "Function " + funcName + " Declaration" );
   funcName = '_' + funcName;
   GenLine( "PUBLIC " + funcName );
   GenLine( funcName + " PROC" );
   GenPush( "ebp" );
   GenMov( "ebp","esp" );
   GenLine();
   return CreateLabel();
}
Esempio n. 24
0
/* EXPORT->AddLabel: append given label info to given label list */
LLink AddLabel(MemHeap *x, LabList *ll, LabId id,
               HTime st, HTime en, float score)
{
   LLink p,q,newLL;
   
   p = ll->tail->pred; q = ll->tail;
   newLL = CreateLabel(x,ll->maxAuxLab);
   newLL->labid = id; newLL->score = score; newLL->start = st; newLL->end = en;
   q->pred = newLL; newLL->succ = q;
   p->succ = newLL; newLL->pred = p;
   return newLL;
}
Esempio n. 25
0
File: MSGBXS.C Progetto: FDOS/defrag
static int MessageBox(char* msg, int btncount, char** buttons,
                      int forcolor, int backcolor,
                      int btnforc, int btnbackc, int btnhighc,
                      char* caption)
{
    int slen, dwidth, btnarea, dialog_x, text_x, i, btn_x, result;
    
    /* Calculate dialog width. */
    slen     = strlen(msg);
    btnarea  = ((btncount-1) * (BUTTON_LENGTH+2)) + BUTTON_LENGTH+1;
    dwidth   = max(btnarea, slen) + 4;
    dialog_x = (MAX_X / 2) - (dwidth / 2);
    
    GenericMsgBxs.caption       = caption;
    GenericMsgBxs.x             = dialog_x;
    GenericMsgBxs.xlen          = dwidth;
    GenericMsgBxs.SurfaceColor  = backcolor;
    GenericMsgBxs.FrameColor    = forcolor;
    GenericMsgBxs.AmofControls  = btncount+1;

    /* Put the text in the dialog. */
    text_x = (slen > btnarea)
           ? dialog_x + 2
           : dialog_x + ((btnarea / 2) - (slen / 2)) + 2;
    
    Controls[0] = CreateLabel(msg, forcolor, backcolor, text_x, TEXT_Y);

    /* Put the buttons on the screen. */
    btn_x = dialog_x + (dwidth / 2) - (btnarea / 2);
    
    for (i = 0; i < btncount; i++) 
    {
        CmdButtons[i].caption   = buttons[i];
        CmdButtons[i].highcolor = btnhighc;

        Controls[i+1] = CreateCommandButton(&CmdButtons[i], 
                                            btnforc, btnbackc,
                                            btn_x, BUTTON_Y,
                                            FALSE, FALSE,
                                            FALSE);
        
        btn_x += BUTTON_LENGTH + 2;
    }

    OpenWindow(&GenericMsgBxs);
    result = ControlWindow(&GenericMsgBxs);
    CloseWindow();

    return result;
}
Esempio n. 26
0
GUIalert::GUIalert(string text, GUI_BaseElement *parent, RECT rect, string styleid, string styleset)
	: GUIpopup(parent, rect, styleid, styleset)
{
	//create the text
	GUI_ElementStyle *style = GUI_Looks::GetStyle(styleid);
	RECT textrect = _R(style->MarginLeft(), style->MarginTop(), width - style->MarginRight(), style->MarginTop() + style->GetFont()->GetfHeight() + 4);
	CreateLabel(text, textrect, POPUP, ALERTTEXT, styleid);

	//create the ok button
	RECT okrect = _R(width / 2 - 20, height - style->MarginBottom() - style->GetFont()->GetfHeight() - 10,
		width / 2 + 20, height - style->MarginBottom());

	CreateDynamicButton("OK", okrect, POPUP, ALERTOKBTN);
}
Esempio n. 27
0
static void Initialize(void)
{
    controls[0] = CreateLabel("Recommended optimization method:",
                              DIALOGFORCOLOR, DIALOGBACKCOLOR,
                              TEXT_X, DIALOG_Y+4);

    controls[1] = CreateCommandButton(&OptimizeButton,
                                      BUTTONFORCOLOR, BUTTONBACKCOLOR,
                                      BUTTON_X1, BUTTON_Y,
                                      FALSE, FALSE, FALSE);

    controls[2] = CreateCommandButton(&ConfigureButton,
                                      BUTTONFORCOLOR, BUTTONBACKCOLOR,
                                      BUTTON_X2, BUTTON_Y,
                                      FALSE, FALSE, FALSE);
}
void
FormWindow::CreateDefLabel(CtrlDef& def)
{
	ActiveWindow* ctrl = CreateLabel(def.GetText(),
	def.GetX(),
	def.GetY(),
	def.GetW(),
	def.GetH(),
	def.GetID(),
	def.GetParentID(),
	def.GetStyle());

	ctrl->SetAltText(def.GetAltText());
	ctrl->SetBackColor(def.GetBackColor());
	ctrl->SetForeColor(def.GetForeColor());
	ctrl->SetTextAlign(def.GetTextAlign());
	ctrl->SetSingleLine(def.GetSingleLine());
	ctrl->SetTransparent(def.GetTransparent());
	ctrl->SetHidePartial(def.GetHidePartial());

	ctrl->SetMargins(def.GetMargins());
	ctrl->SetTextInsets(def.GetTextInsets());
	ctrl->SetCellInsets(def.GetCellInsets());
	ctrl->SetCells(def.GetCells());
	ctrl->SetFixedWidth(def.GetFixedWidth());
	ctrl->SetFixedHeight(def.GetFixedHeight());

	ctrl->UseLayout(def.GetLayout().x_mins,
	def.GetLayout().y_mins,
	def.GetLayout().x_weights,
	def.GetLayout().y_weights);

	if (def.GetTexture().length() > 0) {
		Bitmap*     ctrl_tex = 0;
		DataLoader* loader   = DataLoader::GetLoader();
		loader->SetDataPath("Screens/");
		loader->LoadTexture(def.GetTexture(), ctrl_tex);
		loader->SetDataPath("");

		ctrl->SetTexture(ctrl_tex);
	}

	Font* f = FontMgr::Find(def.GetFont());
	if (f) ctrl->SetFont(f);
}
Esempio n. 29
0
void ActCB(Widget w, XtPointer closure, XtPointer call_data)
{
    register int n;
    Arg args[MAX_ARGS];

    if (PullDown7 == NULL)
    {
        printf("Activate Callback, add a menu\n");
        n = 0;
        PullDown7 = XmCreatePulldownMenu (MenuBar1, "pulldown7", args, n);
        Label7 = CreateLabel("Menu7", PullDown7);
        Separator7    = CreateSeparator(PullDown7, "Separator7");
        PushBtn7      = CreatePushButton("pushbutton7", 'p', PullDown7);

        n = 0;
        XtSetArg(args[n], XmNsubMenuId, PullDown7);
        n++;
        XtSetValues(w, args, n);
        XtManageChild(PullDown7);
    }
}
Esempio n. 30
0
void CascadeCB(Widget w, XtPointer closure, XtPointer call_data)
{
    register int n;
    Arg args[MAX_ARGS];

    if (PullDown6 == NULL)
    {
        printf("Cascading Callback, add a menu\n");
        n = 0;
        PullDown6 = XmCreatePulldownMenu (MenuBar1, "pulldown6", args, n);
        Label6 = CreateLabel("Menu6", PullDown6);
        Separator6    = CreateSeparator(PullDown6, "Separator6");
        PushBtn6      = CreatePushButton("pushbutton6", 'p', PullDown6);

        n = 0;
        XtSetArg(args[n], XmNsubMenuId, PullDown6);
        n++;
        XtSetValues(w, args, n);
        XtManageChild(PullDown6);
    }
}