Esempio n. 1
0
SearchFileParamDialog::SearchFileParamDialog(NCDialogParent *parent, SearchFileParams *params)
:	NCVertDialog(::createDialogAsChild, 0, parent, utf8_to_unicode(_LT("Search")).ptr(), bListOkCancel),
	iL(16, 3),
	maskText(0, this, utf8_to_unicode(_LT("File mask:")).ptr()),
	textText(0, this, utf8_to_unicode(_LT("Text:")).ptr()),
	maskEdit	(0, this, 0, 0, 50),
	textEdit	(0, this, 0, 0, 50),
	caseButton(0, this, utf8_to_unicode(_LT("Case sensitive")).ptr(), 0, params->sens)
{
	if (params->mask.ptr()) maskEdit.SetText(params->mask.ptr(), true);
	if (params->txt.ptr()) textEdit.SetText(params->txt.ptr(), true);
	
	iL.AddWin(&maskText,	0, 0); maskText.Enable(); maskText.Show();
	iL.AddWin(&textText,	1, 0); textText.Enable(); textText.Show();
	
	iL.AddWin(&maskEdit,	0, 1); maskEdit.Enable(); maskEdit.Show(); 
	maskEdit.SetFocus();
	
	iL.AddWin(&textEdit,	1, 1); textEdit.Enable(); textEdit.Show(); 
	
	iL.AddWin(&caseButton, 2, 1); caseButton.Enable(); caseButton.Show(); 
	
	AddLayout(&iL);
	SetEnterCmd(CMD_OK);
	
	order.append(&maskEdit);
	order.append(&textEdit);
	order.append(&caseButton);
	
	SetPosition();
}
Esempio n. 2
0
EditOptDialog::EditOptDialog(NCDialogParent *parent)
:	NCVertDialog(::createDialogAsChild, 0, parent, utf8_to_unicode( _LT("Editor") ).ptr(), bListOkCancel),
	iL(16, 2),

	saveFilePosButton(0, this, utf8_to_unicode( _LT("Save file position") ).ptr(), 0, wcmConfig.editSavePos),
	autoIdentButton(0, this, utf8_to_unicode( _LT("Auto indent") ).ptr(), 0, wcmConfig.editAutoIdent),
	shlButton(0, this, utf8_to_unicode( _LT("Syntax highlighting") ).ptr(), 0, wcmConfig.editShl),
	tabText(0, this, utf8_to_unicode( _LT("Tab size:") ).ptr()), 
	tabEdit(0, this, 0, 0, 16)
{
	char buf[0x100];
	snprintf(buf, sizeof(buf)-1, "%i", wcmConfig.editTabSize);
	tabEdit.SetText(utf8_to_unicode(buf).ptr(), true);

	iL.AddWin(&saveFilePosButton,	0, 0, 0, 1); saveFilePosButton.Enable(); saveFilePosButton.Show(); 
	iL.AddWin(&autoIdentButton,	1, 0, 1, 1); autoIdentButton.Enable(); autoIdentButton.Show(); 
	iL.AddWin(&shlButton,		2, 0, 2, 1); shlButton.Enable(); shlButton.Show(); 
	
	iL.AddWin(&tabText, 		3, 0, 3, 0); tabText.Enable(); tabText.Show();
	iL.AddWin(&tabEdit, 		4, 1, 4, 1); tabEdit.Enable(); tabEdit.Show(); 
	AddLayout(&iL);
	SetEnterCmd(CMD_OK);
	
	saveFilePosButton.SetFocus();
	
	order.append(&saveFilePosButton);
	order.append(&autoIdentButton);
	order.append(&shlButton);
	order.append(&tabEdit);
	SetPosition();
}
Esempio n. 3
0
CmdHistoryDialog::CmdHistoryDialog( int nId, NCDialogParent* parent, NCHistory& history )
	:  NCDialog( createDialogAsChild, nId, parent, utf8_to_unicode( " History " ).data(), bListOkCancel ),
	   _history( history ),
	   _selected( history.Count() - 1 ),
	   _list( Win::WT_CHILD, Win::WH_TABFOCUS | WH_CLICKFOCUS, 0, this, VListWin::SINGLE_SELECT, VListWin::BORDER_3D, 0 )
{
	for ( int i = _history.Count() - 1; i >= 0; i-- ) { _list.Append( _history[i] ); }

	_list.Enable();
	_list.Show();
	_list.SetFocus();
	LSRange h( 10, 1000, 10 );
	LSRange w( 50, 1000, 30 );
	_list.SetHeightRange( h ); //in characters
	_list.SetWidthRange( w ); //in characters

	if ( _history.Count() > 0 )
	{
		_list.MoveFirst( 0 );
		_list.MoveCurrent( _history.Count() - 1 );
	}


	AddWin( &_list );
	SetEnterCmd( CMD_OK );
	SetPosition();
};
Esempio n. 4
0
ReplaceEditParamDialog::ReplaceEditParamDialog(NCDialogParent *parent, ReplaceEditParams *params)
:	NCVertDialog(::createDialogAsChild, 0, parent, utf8_to_unicode(_LT("Replace")).ptr(), bListOkCancel),
	iL(16, 3),
	fromText(0, this, utf8_to_unicode(_LT("Search for:")).ptr()),
	toText(0, this, utf8_to_unicode(_LT("Replace with:")).ptr()),
	fromEdit	(0, this, 0, 0, 50),
	toEdit	(0, this, 0, 0, 50),
	caseButton(0, this, utf8_to_unicode(_LT("Case sensitive")).ptr(), 0, params->sens)
{
	if (params->from.ptr()) fromEdit.SetText(params->from.ptr(), true);
	if (params->to.ptr()) toEdit.SetText(params->to.ptr(), true);
	
	iL.AddWin(&fromText,	0, 0); fromText.Enable(); fromText.Show();
	iL.AddWin(&toText,	1, 0); toText.Enable(); toText.Show();
	
	iL.AddWin(&fromEdit,	0, 1); fromEdit.Enable(); fromEdit.Show(); 
	fromEdit.SetFocus();
	
	iL.AddWin(&toEdit,	1, 1); toEdit.Enable(); toEdit.Show(); 
	
	iL.AddWin(&caseButton, 2, 1); caseButton.Enable(); caseButton.Show(); 
	
	AddLayout(&iL);
	SetEnterCmd(CMD_OK);
	
	order.append(&fromEdit);
	order.append(&toEdit);
	order.append(&caseButton);
	
	SetPosition();
}
Esempio n. 5
0
std::vector<unicode_t> clInputStrDialogBase::ShowDialog()
{
	SetEnterCmd( CMD_OK );

	if ( DoModal() != CMD_OK )
	{
		return std::vector<unicode_t>();
	}

	return GetText();
}
Esempio n. 6
0
	CharsetDlg1(NCDialogParent *parent, int curCharset)
	:	NCDialog(createDialogAsChild, 0, parent, utf8_to_unicode( _LT("Charset") ).ptr(), bListOkCancel), 
		layout(10,10),
		list(this, 7),
		otherButton(0, this, utf8_to_unicode( _LT("Other...") ).ptr(), CMD_OTHER),
		addButton(0, this, utf8_to_unicode( carray_cat<char>(_LT("Add..."), "(Ins)").ptr() ).ptr(), CMD_ADD),
		delButton(0, this, utf8_to_unicode( carray_cat<char>(_LT("Del..."), "(Del)").ptr() ).ptr(), CMD_DEL)
	{ 
		int i;

		InitOperCharsets();
		list.SetList(::csList.ptr(), ::csList.count());
		list.MoveFirst(0);

		for (int i = 0; i < ::csList.count(); i++) 
			if (::csList[i]->id == curCharset) {
				list.MoveCurrent(i);
				break;
			}
		
		/*
			LO
			L
			LA
			LD
		*/
		layout.AddWin(&list,0,0,3,0); list.Enable(); list.Show(); 
		list.SetFocus();
		layout.AddWin(&otherButton,0,1); otherButton.Enable(); otherButton.Show();
		layout.AddWin(&addButton,2,1); addButton.Enable(); addButton.Show();
		layout.AddWin(&delButton,3,1); delButton.Enable(); delButton.Show();

		int mx = 0, my = 0;
		LSize ls;

		otherButton.GetLSize(&ls); if (mx < ls.x.maximal) mx = ls.x.maximal; if (my < ls.y.maximal) my = ls.y.maximal;
		addButton.GetLSize(&ls); if (mx < ls.x.maximal) mx = ls.x.maximal;	if (my < ls.y.maximal) my = ls.y.maximal;
		delButton.GetLSize(&ls); if (mx < ls.x.maximal) mx = ls.x.maximal;	if (my < ls.y.maximal) my = ls.y.maximal;
		ls.x.minimal = ls.x.maximal = mx;
		ls.y.minimal = ls.y.maximal = my;
		otherButton.SetLSize(ls);
		addButton.SetLSize(ls);
		delButton.SetLSize(ls);

		layout.SetLineGrowth(1);

		AddLayout(&layout);
		SetEnterCmd(CMD_OK);
		SetPosition();
	};
Esempio n. 7
0
SysOptDialog::SysOptDialog(NCDialogParent *parent)
:	NCVertDialog(::createDialogAsChild, 0, parent, utf8_to_unicode( _LT("System settings") ).ptr(), bListOkCancel),
	iL(16, 3)

	,askOpenExecButton(0, this, utf8_to_unicode( _LT("Ask user if Exec/Open conflict") ).ptr(), 0, wcmConfig.systemAskOpenExec)
	,escPanelButton(0, this, utf8_to_unicode( _LT("Enable ESC key to show/hide panels") ).ptr(), 0, wcmConfig.systemEscPanel)
	,backUpDirButton(0, this, utf8_to_unicode( _LT("Enable BACKSPACE key to go up dir") ).ptr(), 0, wcmConfig.systemBackSpaceUpDir)
//	,intLocale(this, utf8_to_unicode( _LT("Interface localisation (save config and restart)") ).ptr(), 0, wcmConfig.systemIntLocale)
	,langStatic(0, this, utf8_to_unicode( _LT("Language:") ).ptr())
	,langVal(0, this, utf8_to_unicode( "______________________" ).ptr())
	,langButton(0, this, utf8_to_unicode( ">" ).ptr(), 1000)
{

#ifndef _WIN32
	iL.AddWin(&askOpenExecButton,	0, 0, 0, 2); askOpenExecButton.Enable();  askOpenExecButton.Show(); 
#endif
	iL.AddWin(&escPanelButton,	1, 0, 1, 2); escPanelButton.Enable();  escPanelButton.Show(); 
	iL.AddWin(&backUpDirButton,2, 0, 2, 2); backUpDirButton.Enable(); backUpDirButton.Show();
//	iL.AddWin(&intLocale,		2, 0, 2, 2); intLocale.Enable();  intLocale.Show(); 
	
	iL.AddWin(&langStatic, 		3, 0);	langStatic.Enable();	langStatic.Show();
	iL.AddWin(&langVal,		3, 2);	langVal.Enable();	langVal.Show();
	iL.AddWin(&langButton,		3, 1);	langButton.Enable();	langButton.Show();
	iL.SetColGrowth(2);
	
	AddLayout(&iL);
	SetEnterCmd(CMD_OK);

#ifndef _WIN32
	askOpenExecButton.SetFocus();
	order.append(&askOpenExecButton);
#endif
	order.append(&escPanelButton);
//	order.append(&intLocale);
	order.append(&langButton);

	SetPosition();

#ifdef _WIN32
	LangListLoad( carray_cat<sys_char_t>(GetAppPath().ptr(), utf8_to_sys("\\lang\\list").ptr()).ptr(), list);
#else
	if (!LangListLoad(utf8_to_sys("install-files/share/wcm/lang/list").ptr(), list))
		LangListLoad(utf8_to_sys(UNIX_CONFIG_DIR_PATH "/lang/list").ptr(), list);
#endif
		
	SetCurLang(wcmConfig.systemLang.ptr() ? wcmConfig.systemLang.ptr() : "+");
}
Esempio n. 8
0
FSPromptDialog::FSPromptDialog( PromptCBData* data )
	:  NCVertDialog( ::createDialogAsChild, 0, data->parent, data->header, bListOkCancel ),
	   iL( 16, 3 ),
	   message( 0, this, data->message )
{

	if ( data->message[0] )
	{
		iL.AddWin( &message,  0, 0, 0, 1 );
		message.Enable();
		message.Show();
	}

	int n = data->count;

	if ( n > 16 ) { n = 16; }

	for ( int i = 0; i < data->count; i++ )
	{
		Node node;
		node.prompt = new StaticLine( 0, this, data->prompts[i].prompt.Data() );
		node.ansver = new EditLine( 0, this, 0, 0, 16 );

		if ( !data->prompts[i].visible ) { node.ansver->SetPasswordMode(); }


		iL.AddWin( node.prompt.ptr(),  i + 1, 0, i + 1, 0 );
		iL.AddWin( node.ansver.ptr(),  i + 1, 1, i + 1, 1 );

		node.prompt->Enable();
		node.prompt->Show();
		node.ansver->Enable();
		node.ansver->Show();

		if ( i == 0 ) { node.ansver->SetFocus(); }

		order.append( node.ansver.ptr() ); //порядок с list.append - важен

		list.append( node );

	}

	AddLayout( &iL );
	SetEnterCmd( CMD_OK );

}
Esempio n. 9
0
PanelOptDialog::PanelOptDialog(NCDialogParent *parent)
:	NCVertDialog(::createDialogAsChild, 0, parent, utf8_to_unicode( _LT( "Panel settings") ).ptr(), bListOkCancel),
	iL(16, 3),
	showHiddenButton(0, this, utf8_to_unicode( _LT("Show hidden files") ).ptr(), 0, wcmConfig.panelShowHiddenFiles),
	showIconsButton(0, this, utf8_to_unicode( _LT("Show icons") ).ptr(), 0, wcmConfig.panelShowIcons),
	caseSensitive(0, this, utf8_to_unicode( _LT("Case sensitive sort") ).ptr(), 0, wcmConfig.panelCaseSensitive)
{
	iL.AddWin(&showHiddenButton,	0, 0); showHiddenButton.Enable(); showHiddenButton.SetFocus(); showHiddenButton.Show(); 
	iL.AddWin(&showIconsButton,	1, 0); showIconsButton.Enable(); showIconsButton.Show(); 
	iL.AddWin(&caseSensitive,	2, 0); caseSensitive.Enable(); caseSensitive.Show(); 
	AddLayout(&iL);
	SetEnterCmd(CMD_OK);

	showHiddenButton.SetFocus();
	
	order.append(&showHiddenButton);
	order.append(&showIconsButton);
	order.append(&caseSensitive);
	SetPosition();
}
Esempio n. 10
0
	CharsetDialog(NCDialogParent *parent, int curCharset, const char *headerText, charset_struct **cslist, int csCount)
	:	NCDialog(createDialogAsChild, 0, parent, utf8_to_unicode(headerText).ptr(), bListOkCancel), 
		_list(this, 15)
	{ 
		_list.SetList(cslist, csCount);

		_list.Enable();
		_list.Show();
		_list.SetFocus();
		
		_list.MoveFirst(0);
		_list.MoveCurrent(0);
		for (int i = 0; i < csCount; i++) 
			if (cslist[i]->id == curCharset) {
				_list.MoveCurrent(i);
				break;
			}
		
		AddWin(&_list);
		SetEnterCmd(CMD_OK);
		SetPosition();
	};
Esempio n. 11
0
	CfgLangDialog(NCDialogParent *parent, char *id, ccollect<LangListNode> *nl)
	:	NCDialog(createDialogAsChild, 0, parent, utf8_to_unicode( _LT("Language") ).ptr(), bListOkCancel), 
		_selected(0),
		_list(Win::WT_CHILD,Win::WH_TABFOCUS|WH_CLICKFOCUS, 0, this, VListWin::SINGLE_SELECT, VListWin::BORDER_3D, 0),
		nodeList(nl)
		
	{ 
		_list.Append( utf8_to_unicode( _LT("Autodetect") ).ptr()); //0
		_list.Append( utf8_to_unicode( _LT("English") ).ptr()); //1
		
		for (int i = 0; i<nl->count(); i++)
			_list.Append( utf8_to_unicode(nl->get(i).name.ptr()).ptr() );
			
		int cur = 0;
		if (id[0] == '+') cur = 0;
		else if (id[0] == '-') cur = 1;
		else {
			for (int i = 0; i<nl->count(); i++)
				if (!strcmp(id, nl->get(i).id.ptr()))
				{
					cur = i+2;
					break;
				}
		}
		_list.MoveCurrent(cur);
		
		_list.Enable();
		_list.Show();
		_list.SetFocus();
		LSRange h(10, 1000, 10);
		LSRange w(50, 1000, 30);
		_list.SetHeightRange(h); //in characters
		_list.SetWidthRange(w); //in characters
		
		AddWin(&_list);
		SetEnterCmd(CMD_OK);
		SetPosition();
	};
Esempio n. 12
0
TerminalOptDialog::TerminalOptDialog(NCDialogParent *parent)
:	NCVertDialog(::createDialogAsChild, 0, parent, utf8_to_unicode( _LT("Terminal options") ).ptr(), bListOkCancel),
	iL(16, 3),
	backspaceKeyStatic(0, this, utf8_to_unicode( _LT("Backspace key:") ).ptr()),
	backspaceAsciiButton(0, this, utf8_to_unicode("ASCII DEL").ptr(), 1, wcmConfig.terminalBackspaceKey == 0),
	backspaceCtrlHButton(0, this,  utf8_to_unicode("Ctrl H").ptr(), 1, wcmConfig.terminalBackspaceKey == 1)
{
	iL.AddWin(&backspaceKeyStatic,	0, 0, 0, 1 ); backspaceKeyStatic.Enable(); backspaceKeyStatic.Show(); 
	iL.AddWin(&backspaceAsciiButton,	1, 1); backspaceAsciiButton.Enable(); backspaceAsciiButton.Show(); 
	iL.AddWin(&backspaceCtrlHButton,	2, 1); backspaceCtrlHButton.Enable(); backspaceCtrlHButton.Show(); 

	iL.ColSet(0,10,10,10);
	iL.SetColGrowth(1);
	
	AddLayout(&iL);
	SetEnterCmd(CMD_OK);

	backspaceAsciiButton.SetFocus();
	
	order.append(&backspaceAsciiButton);
	order.append(&backspaceCtrlHButton);
	SetPosition();
}
Esempio n. 13
0
StyleOptDialog::StyleOptDialog(NCDialogParent *parent, ccollect<Node> *p)
:	NCVertDialog(::createDialogAsChild, 0, parent, utf8_to_unicode( _LT("Style") ).ptr(), bListOkCancel),
	iL(16, 3),
	pList(p),
	colorStatic(0, this, utf8_to_unicode( _LT("Colors:") ).ptr()),
	styleDefButton(0, this, utf8_to_unicode( _LT("Default colors") ).ptr(), 1, wcmConfig.panelColorMode!=1 && wcmConfig.panelColorMode!=2 ),
	styleBlackButton(0, this,  utf8_to_unicode( _LT("Black") ).ptr(), 1, wcmConfig.panelColorMode == 1),
	styleWhiteButton(0, this, utf8_to_unicode( _LT("White") ).ptr(), 1, wcmConfig.panelColorMode == 2),

showStatic(0, this, utf8_to_unicode( _LT("Items:") ).ptr()),
showToolbarButton(0, this, utf8_to_unicode( _LT("Show toolbar") ).ptr(), 0, wcmConfig.showToolBar),
showButtonbarButton(0, this, utf8_to_unicode( _LT("Show buttonbar") ).ptr(), 0, wcmConfig.showButtonBar),

	fontsStatic(0, this, utf8_to_unicode( _LT("Fonts:") ).ptr()),
	fontList(Win::WT_CHILD, WH_TABFOCUS | WH_CLICKFOCUS, 0, this, VListWin::SINGLE_SELECT, VListWin::BORDER_3D, 0),
	fontNameStatic(0, this, utf8_to_unicode("--------------------------------------------------").ptr()),
	changeButton(0, this, utf8_to_unicode( _LT("Set font...") ).ptr(), CMD_CHFONT),
	changeX11Button(0, this, utf8_to_unicode( _LT("Set X11 font...") ).ptr(), CMD_CHFONTX11)
{
	iL.AddWin(&colorStatic,	0, 0 ); colorStatic.Enable(); colorStatic.Show(); 
	iL.AddWin(&styleDefButton,	1, 1); styleDefButton.Enable(); styleDefButton.Show(); 
	iL.AddWin(&styleBlackButton,	2, 1); styleBlackButton.Enable(); styleBlackButton.Show(); 
	iL.AddWin(&styleWhiteButton,	3, 1); styleWhiteButton.Enable(); styleWhiteButton.Show(); 

	iL.AddWin(&showStatic,	4, 0 ); showStatic.Enable(); showStatic.Show(); 
	iL.AddWin(&showToolbarButton,	5, 1); showToolbarButton.Enable(); showToolbarButton.Show(); 
	iL.AddWin(&showButtonbarButton,	6, 1); showButtonbarButton.Enable(); showButtonbarButton.Show(); 

	iL.LineSet(7,10);
	iL.AddWin(&fontsStatic,	8, 0); fontsStatic.Enable(); fontsStatic.Show(); 
	
	iL.ColSet(0,10,10,10);
	iL.SetColGrowth(1);
	
	for (int i = 0; i<pList->count(); i++)
		fontList.Append(utf8_to_unicode(pList->get(i).name.ptr()).ptr(), i);
		
	fontList.MoveCurrent(0);
	RefreshFontInfo();
	
	LSize lsize = fontList.GetLSize();
	lsize.y.minimal = lsize.y.ideal = 100;
	lsize.y.maximal = 1000;
	lsize.x.minimal = lsize.x.ideal = 300;
	lsize.x.maximal = 1000;
	fontList.SetLSize(lsize);
	
	iL.AddWin(&fontList, 8, 1); fontList.Enable(); fontList.Show(); 
	
	fontNameStatic.Enable(); fontNameStatic.Show(); 
	
	lsize = fontNameStatic.GetLSize();
	lsize.x.minimal = 500;
	lsize.x.maximal = 1000;
	fontNameStatic.SetLSize(lsize);
	
	iL.AddWin(&fontNameStatic, 9, 1);
#ifdef USEFREETYPE	
	iL.AddWin(&changeButton, 10, 1); changeButton.Enable(); changeButton.Show(); 
#endif	

#ifdef _WIN32
	iL.AddWin(&changeButton, 10, 1); changeButton.Enable(); changeButton.Show(); 
#else
	iL.AddWin(&changeX11Button, 11, 1); changeX11Button.Enable(); changeX11Button.Show(); 
	iL.LineSet(12,10);
#endif

#ifdef USEFREETYPE			
	LSize l1 = changeButton.GetLSize();
	LSize l2 = changeX11Button.GetLSize();
	if (l1.x.minimal < l2.x.minimal) l1.x.minimal = l2.x.minimal;
	l1.x.maximal = l1.x.minimal;
	changeButton.SetLSize(l1);
	changeX11Button.SetLSize(l1);
#endif	

	AddLayout(&iL);
	SetEnterCmd(CMD_OK);

	styleDefButton.SetFocus();
	
	order.append(&styleDefButton);
	order.append(&styleBlackButton);
	order.append(&styleWhiteButton);
	order.append(&showToolbarButton);
	order.append(&showButtonbarButton);
	order.append(&fontList);
	order.append(&changeButton);
	order.append(&changeX11Button);
	SetPosition();
}
Esempio n. 14
0
	clFileAttributesWin( NCDialogParent* parent, PanelWin* Panel )
	 : NCVertDialog( ::createDialogAsChild, 0, parent, utf8_to_unicode(_LT("Attributes")).data(), bListOkCancel )
	 , m_Panel( Panel )
	 , m_Node( Panel ? Panel->GetCurrent() : nullptr )
	 , m_URI( Panel ? Panel->UriOfCurrent() : FSString() )
	 , m_Layout( 17, 3 )
	 , m_CaptionText( 0, this, utf8_to_unicode( _LT( "" ) ).data(), nullptr, StaticLine::CENTER )
	 , m_FileNameText( uiValue, this, utf8_to_unicode( _LT( "" ) ).data(), nullptr, StaticLine::CENTER )
#if defined(_WIN32)
	 , m_ReadOnly( uiVariable, this, utf8_to_unicode( _LT( "Read only" ) ).data(), 0, false )
	 , m_Archive( uiVariable, this, utf8_to_unicode( _LT( "Archive" ) ).data(), 0, false )
	 , m_Hidden( uiVariable, this, utf8_to_unicode( _LT( "Hidden" ) ).data(), 0, false )
	 , m_System( uiVariable, this, utf8_to_unicode( _LT( "System" ) ).data(), 0, false )
	 , m_Compressed( 0, this, utf8_to_unicode( _LT( "Compressed" ) ).data(), 0, false )
	 , m_Encrypted( 0, this, utf8_to_unicode( _LT( "Encrypted" ) ).data(), 0, false )
	 , m_NotIndexed( 0, this, utf8_to_unicode( _LT( "NotIndexed" ) ).data(), 0, false )
	 , m_Sparse( 0, this, utf8_to_unicode( _LT( "Sparse" ) ).data(), 0, false )
	 , m_Temporary( 0, this, utf8_to_unicode( _LT( "Temporary" ) ).data(), 0, false )
	 , m_Offline( 0, this, utf8_to_unicode( _LT( "Offline" ) ).data(), 0, false )
	 , m_ReparsePoint( 0, this, utf8_to_unicode( _LT( "ReparsePoint" ) ).data(), 0, false )
	 , m_Virtual( 0, this, utf8_to_unicode( _LT( "Virtual" ) ).data(), 0, false )
#else
	 , m_UserRead( uiVariable, this, utf8_to_unicode( _LT( "User &read" ) ).data(), 0, false )
	 , m_UserWrite( uiVariable, this, utf8_to_unicode( _LT( "User &write" ) ).data(), 0, false )
    , m_UserExecute( uiVariable, this, utf8_to_unicode( _LT( "User e&xecute" ) ).data(), 0, false )
	 , m_GroupRead( uiVariable, this, utf8_to_unicode( _LT( "&Group read" ) ).data(), 0, false )
	 , m_GroupWrite( uiVariable, this, utf8_to_unicode( _LT( "Group write" ) ).data(), 0, false )
	 , m_GroupExecute( uiVariable, this, utf8_to_unicode( _LT( "Group execute" ) ).data(), 0, false )
	 , m_OthersRead( uiVariable, this, utf8_to_unicode( _LT( "&Others read" ) ).data(), 0, false )
	 , m_OthersWrite( uiVariable, this, utf8_to_unicode( _LT( "Others write" ) ).data(), 0, false )
	 , m_OthersExecute( uiVariable, this, utf8_to_unicode( _LT( "Others execute" ) ).data(), 0, false )
#endif
	// time
	 , m_LastWriteTimeLabel( 0, this, utf8_to_unicode( _LT( "Last write time" ) ).data(), nullptr, StaticLine::LEFT )
	 , m_CreationTimeLabel( 0, this, utf8_to_unicode( _LT( "Creation time" ) ).data(), nullptr, StaticLine::LEFT )
	 , m_LastAccessTimeLabel( 0, this, utf8_to_unicode( _LT( "Last access time" ) ).data(), nullptr, StaticLine::LEFT )
	 , m_ChangeTimeLabel( 0, this, utf8_to_unicode( _LT( "Change time" ) ).data(), nullptr, StaticLine::LEFT )
	 //
	 , m_LastWriteDate( 0, this, nullptr, utf8_to_unicode( _LT( "DD.MM.YYYY" ) ).data(), 9 )
	 , m_CreationDate( 0, this, nullptr, utf8_to_unicode( _LT( "DD.MM.YYYY" ) ).data(), 9 )
	 , m_LastAccessDate( 0, this, nullptr, utf8_to_unicode( _LT( "DD.MM.YYYY" ) ).data(), 9 )
	 , m_ChangeDate( 0, this, nullptr, utf8_to_unicode( _LT( "DD.MM.YYYY" ) ).data(), 9 )
	 //
	 , m_LastWriteTime( 0, this, nullptr, utf8_to_unicode( _LT( "HH:MM:SS" ) ).data(), 13 )
	 , m_CreationTime( 0, this, nullptr, utf8_to_unicode( _LT( "HH:MM:SS" ) ).data(), 13 )
	 , m_LastAccessTime( 0, this, nullptr, utf8_to_unicode( _LT( "HH:MM:SS" ) ).data(), 13 )
	 , m_ChangeTime( 0, this, nullptr, utf8_to_unicode( _LT( "HH:MM:SS" ) ).data(), 13 )
	{
		if ( m_Panel )
		{
			const unicode_t* FileName = m_Panel->GetCurrentFileName();

			m_FileNameText.SetText( FileName );
		}

		if ( m_Node && m_Node->IsDir() )
		{
			m_CaptionText.SetText( utf8_to_unicode( _LT("Change attributes for folder:") ).data() );
		}
		else
		{
			m_CaptionText.SetText( utf8_to_unicode( _LT("Change file attributes for:") ).data() );
		}

		int Row = 0;

		m_Layout.AddWinAndEnable( &m_CaptionText, Row, 0, Row, 2 ); Row++;
		m_Layout.AddWinAndEnable( &m_FileNameText, Row, 0, Row, 2 ); Row++;

		int TRow = Row;

#if defined(_WIN32)
		m_Layout.AddWinAndEnable( &m_ReadOnly, Row++, 0 );
		m_Layout.AddWinAndEnable( &m_Archive, Row++, 0 );
		m_Layout.AddWinAndEnable( &m_Hidden, Row++, 0 );
		m_Layout.AddWinAndEnable( &m_System, Row++, 0 );
		m_Layout.AddWinAndEnable( &m_Compressed, Row++, 0 );
		m_Layout.AddWinAndEnable( &m_Encrypted, Row++, 0 );
		Row = TRow;
		m_Layout.AddWinAndEnable( &m_NotIndexed, Row++, 1 );
		m_Layout.AddWinAndEnable( &m_Sparse, Row++, 1 );
		m_Layout.AddWinAndEnable( &m_Temporary, Row++, 1 );
		m_Layout.AddWinAndEnable( &m_Offline, Row++, 1 );
		m_Layout.AddWinAndEnable( &m_ReparsePoint, Row++, 1 );
		m_Layout.AddWinAndEnable( &m_Virtual, Row++, 1 );

		// disable editing of these properties
		m_Compressed.Enable( false );
		m_Encrypted.Enable( false );
		m_NotIndexed.Enable( false );
		m_Sparse.Enable( false );
		m_Temporary.Enable( false );
		m_Offline.Enable( false );
		m_ReparsePoint.Enable( false );
		m_Virtual.Enable( false );
#else
		m_Layout.AddWinAndEnable( &m_UserRead, Row, 0 );
		m_Layout.AddWinAndEnable( &m_UserWrite, Row, 1 );
		m_Layout.AddWinAndEnable( &m_UserExecute, Row, 2 );
		Row++;
		m_Layout.AddWinAndEnable( &m_GroupRead, Row, 0 );
		m_Layout.AddWinAndEnable( &m_GroupWrite, Row, 1 );
		m_Layout.AddWinAndEnable( &m_GroupExecute, Row, 2 );
		Row++;
		m_Layout.AddWinAndEnable( &m_OthersRead, Row, 0 );
		m_Layout.AddWinAndEnable( &m_OthersWrite, Row, 1 );
		m_Layout.AddWinAndEnable( &m_OthersExecute, Row, 2 );
#endif

		m_Layout.LineSet( Row++, 5 );

		TRow = Row;
		m_Layout.AddWinAndEnable( &m_LastWriteTimeLabel, Row++, 0 );
		m_Layout.AddWinAndEnable( &m_CreationTimeLabel, Row++, 0 );
		m_Layout.AddWinAndEnable( &m_LastAccessTimeLabel, Row++, 0 );
#if defined(HAS_CHANGETIME)
		m_Layout.AddWinAndEnable( &m_ChangeTimeLabel, Row++, 0 );
#endif
		Row = TRow;
		m_Layout.AddWinAndEnable( &m_LastWriteDate, Row++, 1 );
		m_Layout.AddWinAndEnable( &m_CreationDate, Row++, 1 );
		m_Layout.AddWinAndEnable( &m_LastAccessDate, Row++, 1 );
#if defined(HAS_CHANGETIME)
		m_Layout.AddWinAndEnable( &m_ChangeDate, Row++, 1 );
#endif
		Row = TRow;
		m_Layout.AddWinAndEnable( &m_LastWriteTime, Row++, 2 );
		m_Layout.AddWinAndEnable( &m_CreationTime, Row++, 2 );
		m_Layout.AddWinAndEnable( &m_LastAccessTime, Row++, 2 );
#if defined(HAS_CHANGETIME)
		m_Layout.AddWinAndEnable( &m_ChangeTime, Row++, 2 );
#endif

		m_LastWriteDate.SetValidator( new clDateValidator() );
		m_LastWriteDate.SetReplaceMode( true );
		m_CreationDate.SetValidator( new clDateValidator() );
		m_CreationDate.SetReplaceMode( true );
		m_LastAccessDate.SetValidator( new clDateValidator() );
		m_LastAccessDate.SetReplaceMode( true );
#if defined(HAS_CHANGETIME)
		m_ChangeDate.SetValidator( new clDateValidator() );
		m_ChangeDate.SetReplaceMode( true );
#endif
		m_LastWriteTime.SetValidator( new clTimeValidator() );
		m_LastWriteTime.SetReplaceMode( true );
		m_CreationTime.SetValidator( new clTimeValidator() );
		m_CreationTime.SetReplaceMode( true );
		m_LastAccessTime.SetValidator( new clTimeValidator() );
		m_LastAccessTime.SetReplaceMode( true );
#if defined(HAS_CHANGETIME)
		m_ChangeTime.SetValidator( new clTimeValidator() );
		m_ChangeTime.SetReplaceMode( true );
#endif

		UpdateAttributes( m_Node );
		
		AddLayout( &m_Layout );

		order.clear();
#if defined(_WIN32)
		order.append(&m_ReadOnly);
		order.append(&m_Archive);
		order.append(&m_Hidden);
		order.append(&m_System);
#else
		order.append(&m_UserRead);
		order.append(&m_UserWrite);
		order.append(&m_UserExecute);
		order.append(&m_GroupRead);
		order.append(&m_GroupWrite);
		order.append(&m_GroupExecute);
		order.append(&m_OthersRead);
		order.append(&m_OthersWrite);
		order.append(&m_OthersExecute);
#endif // _WIN32
		order.append(&m_LastWriteDate);
		order.append(&m_LastWriteTime);
		order.append(&m_CreationDate);
		order.append(&m_CreationTime);
		order.append(&m_LastAccessDate);
		order.append(&m_LastAccessTime);
#if defined(HAS_CHANGETIME)
		order.append(&m_ChangeDate);
		order.append(&m_ChangeTime);
#endif // HAS_CHANGETIME

		SetEnterCmd( CMD_OK );
		SetPosition();
	}
Esempio n. 15
0
SftpLogonDialog::SftpLogonDialog( NCDialogParent* parent, FSSftpParam& params )
	:  NCVertDialog( ::createDialogAsChild, 0, parent, utf8_to_unicode( _LT( "SFTP logon" ) ).data(), bListOkCancel ),
	   iL( 16, 3 ),
	   serverText(0, this, utf8_to_unicode(_LT("&Server:")).data(), &serverEdit),
	   userText(0, this, utf8_to_unicode(_LT("&Login:"******"Password:"******"&Port:" ) ).data(), &portEdit ),
	   charsetText(0, this, utf8_to_unicode(_LT("&Charset:")).data(), &charsetButton),
	   charsetIdText( 0, this, utf8_to_unicode( "***************" ).data() ), //чтоб место забить

	   charset( params.charset ),

	   serverEdit  ( 0, this, 0, 0, 16 ),
	   userEdit ( 0, this, 0, 0, 16 ),
//	passwordEdit   (this, 0, 0, 16),
	   portEdit ( 0, this, 0, 0, 7 ),

	   charsetButton( 0, this, utf8_to_unicode( ">" ).data() , 1000 )
{
	serverEdit.SetText( params.server.Data(), true );
	userEdit.SetText( params.user.Data(), true );
//	passwordEdit.SetText(params.pass.Data(), true);

	char buf[0x100];
	snprintf( buf, sizeof( buf ), "%i", params.port );
	portEdit.SetText( utf8_to_unicode( buf ).data(), true );

	bool focus = false;

	iL.AddWin( &serverText,  0, 0, 0, 0 );
	serverText.Enable();
	serverText.Show();
	iL.AddWin( &serverEdit,  0, 1, 0, 1 );
	serverEdit.Enable();
	serverEdit.Show();

	if ( !focus && !params.server.Data()[0] ) { serverEdit.SetFocus(); focus = true; }

	iL.AddWin( &userText, 2, 0, 2, 0 );
	userText.Enable();
	userText.Show();
	iL.AddWin( &userEdit, 2, 1, 2 , 1 );
	userEdit.Enable();
	userEdit.Show();

	if ( !focus && !params.user.Data()[0] ) { userEdit.SetFocus(); focus = true; }

	/*
	   passwordEdit.SetPasswordMode();
	   iL.AddWin(&passwordText, 3, 0, 3, 0);  passwordText.Enable(); passwordText.Show();
	   iL.AddWin(&passwordEdit, 3, 1, 3, 1);  passwordEdit.Enable(); passwordEdit.Show();
	   if (!focus && !params.pass.Data()[0]) { passwordEdit.SetFocus(); focus = true; }
	*/

	iL.AddWin( &portText, 4, 0, 4, 0 );
	portText.Enable();
	portText.Show();
	iL.AddWin( &portEdit, 4, 1, 4, 1 );
	portEdit.Enable();
	portEdit.Show();

	iL.AddWin( &charsetText, 5, 0, 5, 0 );
	charsetText.Enable();
	charsetText.Show();
	charsetIdText.SetText( utf8_to_unicode( charset_table[params.charset]->name ).data() );
	iL.AddWin( &charsetIdText, 5, 1, 5, 1 );
	charsetIdText.Enable();
	charsetIdText.Show();
	iL.AddWin( &charsetButton, 5, 2 );
	charsetButton.Enable();
	charsetButton.Show();

	AddLayout( &iL );
	SetEnterCmd( CMD_OK );

	order.append( &serverEdit );
	order.append( &userEdit );
//	order.append(&passwordEdit);
	order.append( &portEdit );
	order.append( &charsetButton );
	SetPosition();
}
Esempio n. 16
0
SmbLogonDialog::SmbLogonDialog( NCDialogParent* parent, FSSmbParam& params, bool enterServer )
	:  NCVertDialog( ::createDialogAsChild, 0, parent, utf8_to_unicode( _LT( "SMB logon" ) ).data(), bListOkCancel ),
	   iL( 16, 2 ),
	   text( 0, this, utf8_to_unicode( carray_cat<char>( _LT( "Server:" ), const_cast<char*>( params.server ) ).data() ).data() ),
	   serverInput( enterServer ),
	   serverText( 0, this, utf8_to_unicode( _LT( "Server:" ) ).data() ),
	   domainText( 0, this, utf8_to_unicode( _LT( "Domain:" ) ).data() ),
	   userText( 0, this, utf8_to_unicode( _LT( "Login:"******"Password:" ) ).data() ),
	   serverEdit  ( 0, this, 0, 0, 16 ),
	   domainEdit  ( 0, this, 0, 0, 16 ),
	   userEdit ( 0, this, 0, 0, 16 ),
	   passwordEdit   ( 0, this, 0, 0, 16 )
{

	serverEdit.SetText( utf8_to_unicode( const_cast<char*>( params.server ) ).data(), true );
	domainEdit.SetText( utf8_to_unicode( const_cast<char*>( params.domain ) ).data(), true );
	userEdit.SetText( utf8_to_unicode( const_cast<char*>( params.user ) ).data(), true );
	passwordEdit.SetText( utf8_to_unicode( const_cast<char*>( params.pass ) ).data(), true );

	bool focus = false;

	if ( serverInput )
	{
		iL.AddWin( &serverText,  0, 0 );
		serverText.Enable();
		serverText.Show();
		iL.AddWin( &serverEdit,  0, 1 );
		serverEdit.Enable();
		serverEdit.Show();

		if ( !focus && !params.server[0] ) { serverEdit.SetFocus(); focus = true; }
	}
	else
	{
		iL.AddWin( &text, 0, 0, 0, 1 );
		text.Enable();
		text.Show();
	}

	iL.AddWin( &domainText,  1, 0 );
	domainText.Enable();
	domainText.Show();
	iL.AddWin( &domainEdit,  1, 1 );
	domainEdit.Enable();
	domainEdit.Show();

	if ( !focus && !params.domain[0] ) { domainEdit.SetFocus(); focus = true; }

	iL.AddWin( &userText, 2, 0 );
	userText.Enable();
	userText.Show();
	iL.AddWin( &userEdit, 2, 1 );
	userEdit.Enable();
	userEdit.Show();

	if ( !focus && !params.user[0] ) { userEdit.SetFocus(); focus = true; }

	passwordEdit.SetPasswordMode();
	iL.AddWin( &passwordText, 3, 0 );
	passwordText.Enable();
	passwordText.Show();
	iL.AddWin( &passwordEdit, 3, 1 );
	passwordEdit.Enable();
	passwordEdit.Show();

	if ( !focus && !params.pass[0] ) { passwordEdit.SetFocus(); focus = true; }

	AddLayout( &iL );
	SetEnterCmd( CMD_OK );

	order.append( &serverEdit );
	order.append( &domainEdit );
	order.append( &userEdit );
	order.append( &passwordEdit );

	SetPosition();
}