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(); };
CopyDialog(NCDialogParent *parent, bool move = false) : SimpleCFThreadWin(parent, move ? _LT("Move") : _LT("Copy") ), _layout(7,2), _text1(0, this, utf8_to_unicode(move ? _LT("Moving the file") : _LT("Copying the file") ).ptr()), _text2(0, this, utf8_to_unicode( _LT("to") ).ptr()), _text3(0, this, utf8_to_unicode( _LT("Files processed") ).ptr()), _from(this), _to(this), _countWin(this), _progressWin(this) { _layout.AddWin(&_text1, 0, 0, 0, 1); _layout.AddWin(&_from, 1, 0, 1, 1); _layout.AddWin(&_text2, 2, 0, 2, 1); _layout.AddWin(&_to, 3, 0, 3, 1); _layout.AddWin(&_progressWin, 4,0,4,1); _layout.AddWin(&_text3, 5, 0); _layout.AddWin(&_countWin, 5, 1); _text1.Show(); _text1.Enable(); _text2.Show(); _text2.Enable(); _text3.Show(); _text3.Enable(); _from.Show(); _from.Enable(); _to.Show(); _to.Enable(); _countWin.Show(); _countWin.Enable(); _progressWin.Show(); _progressWin.Enable(); AddLayout(&_layout); SetPosition(); }
clFileAssociationsWin( NCDialogParent* parent, std::vector<clNCFileAssociation>* Associations ) : NCDialog( ::createDialogAsChild, 0, parent, utf8_to_unicode( _LT( "File associations" ) ).data(), bListOkCancel ) , m_ListWin( this, Associations ) , m_Layout( 10, 10 ) , m_AddCurrentButton( 0, this, utf8_to_unicode( "+ (&Ins)" ).data(), CMD_PLUS ) , m_DelButton( 0, this, utf8_to_unicode( "- (&Del)" ).data(), CMD_MINUS ) , m_EditButton( 0, this, utf8_to_unicode( _LT( "&Edit" ) ).data(), CMD_EDIT ) , m_Saved( true ) { m_AddCurrentButton.Enable(); m_AddCurrentButton.Show(); m_DelButton.Enable(); m_DelButton.Show(); m_EditButton.Enable(); m_EditButton.Show(); LSize lsize = m_AddCurrentButton.GetLSize(); LSize lsize2 = m_DelButton.GetLSize(); LSize lsize3 = m_EditButton.GetLSize(); if ( lsize.x.minimal < lsize2.x.minimal ) { lsize.x.minimal = lsize2.x.minimal; } if ( lsize.x.minimal < lsize3.x.minimal ) { lsize.x.minimal = lsize3.x.minimal; } if ( lsize.x.maximal < lsize.x.minimal ) { lsize.x.maximal = lsize.x.minimal; } m_AddCurrentButton.SetLSize( lsize ); m_DelButton.SetLSize( lsize ); m_EditButton.SetLSize( lsize ); m_Layout.AddWinAndEnable( &m_ListWin, 0, 0, 9, 0 ); m_Layout.AddWin( &m_AddCurrentButton, 0, 1 ); m_Layout.AddWin( &m_DelButton, 1, 1 ); m_Layout.AddWin( &m_EditButton, 2, 1 ); m_Layout.SetLineGrowth( 9 ); this->AddLayout( &m_Layout ); SetPosition(); m_ListWin.SetFocus(); this->SetEnterCmd( CMD_OK ); }
FoldersHistoryDlg( NCDialogParent* parent, PathList& dataList ) : PathListDlg( parent, m_historyWin, _LT( "Folders History" ), 0 ) , m_historyWin( this, dataList ) , m_lo( 10, 10 ) { m_ListWin.Show(); m_ListWin.Enable(); m_lo.AddWin( &m_ListWin, 0, 0, 9, 0 ); m_lo.SetLineGrowth( 9 ); AddLayout( &m_lo ); SetPosition(); m_ListWin.SetFocus(); if ( dataList.GetCount() > 0 ) { // select the last item and make it visible m_ListWin.MoveCurrent( dataList.GetCount() - 1 ); } }
CopyDialog( NCDialogParent* parent, bool move = false ) : SimpleCFThreadWin( parent, move ? _LT( "Move" ) : _LT( "Copy" ) ), _layout( 7, 2 ), _text1( 0, this, utf8_to_unicode( move ? _LT( "Moving the file" ) : _LT( "Copying the file" ) ).data() ), _text2( 0, this, utf8_to_unicode( _LT( "to" ) ).data() ), _text3( 0, this, utf8_to_unicode( _LT( "Files processed" ) ).data() ), _from( this ), _to( this ), _countWin( this ), _progressWin( this ), _speedStr( uiValue, this, 0, 0, StaticLine::LEFT, 10 ), _lastMs( GetTickMiliseconds() ) { _layout.AddWin( &_text1, 0, 0, 0, 1 ); _layout.AddWin( &_from, 1, 0, 1, 1 ); _layout.AddWin( &_text2, 2, 0, 2, 1 ); _layout.AddWin( &_to, 3, 0, 3, 1 ); _layout.AddWin( &_progressWin, 4, 0, 4, 1 ); _layout.AddWin( &_text3, 5, 0 ); _layout.AddWin( &_countWin, 5, 1 ); _layout.AddWin( &_speedStr, 6, 0 ); _text1.Show(); _text1.Enable(); _text2.Show(); _text2.Enable(); _text3.Show(); _text3.Enable(); _from.Show(); _from.Enable(); _to.Show(); _to.Enable(); _countWin.Show(); _countWin.Enable(); _progressWin.Show(); _progressWin.Enable(); _speedStr.Show(); _speedStr.Enable(); AddLayout( &_layout ); SetTimer( 1, 1000 ); SetPosition(); }
DirCalcThreadWin( NCDialogParent* parent, const char* name, OperDirCalcData* pD, const unicode_t* dirName ) : NCDialog( ::createDialogAsChild, 0, parent, utf8_to_unicode( name ).data(), bListOk ), pData( pD ), lo( 12, 10 ), cPathWin( this ), curFileCount( -1 ), curFolderCount( -1 ), curSumSize( -1 ), curBadDirs( -1 ), dirString( 0, this, ScanedDirString( dirName ).data() ), fileCountName( uiVariable, this, utf8_to_unicode( _LT( "Files:" ) ).data() ), fileCountNum( uiValue, this, utf8_to_unicode( "AAAAAAAAAA" ).data() ), folderCountName( uiVariable, this, utf8_to_unicode( _LT( "Folders:" ) ).data() ), folderCountNum( uiValue, this, utf8_to_unicode( "AAAAAAAAAA" ).data() ), sumSizeName( uiVariable, this, utf8_to_unicode( _LT( "Files size:" ) ).data() ), sumSizeNum( uiValue, this, utf8_to_unicode( "AAAAAAAAAAAAAAAAAAAA" ).data() ), badDirsName( uiVariable, this, utf8_to_unicode( _LT( "Not readable folders:" ) ).data() ), badDirsNum( uiValue, this, utf8_to_unicode( "AAAAAAAAAA" ).data() ) { lo.AddWin( &dirString, 0, 0, 0, 3 ); lo.AddWin( &cPathWin, 9, 0, 9, 3 ); lo.LineSet( 1, 10 ); lo.AddWin( &fileCountName, 3, 1 ); lo.AddWin( &folderCountName, 4, 1 ); lo.AddWin( &sumSizeName, 5, 1 ); lo.AddWin( &fileCountNum, 3, 2 ); lo.AddWin( &folderCountNum, 4, 2 ); lo.AddWin( &sumSizeNum, 5, 2 ); lo.LineSet( 6, 7 ); lo.AddWin( &badDirsName, 7, 1 ); lo.AddWin( &badDirsNum, 7, 2 ); lo.LineSet( 8, 10 ); dirString.Show(); dirString.Enable(); cPathWin.Show(); cPathWin.Enable(); fileCountName.Show(); fileCountName.Enable(); fileCountNum.Show(); fileCountNum.Enable(); folderCountName.Show(); folderCountName.Enable(); folderCountNum.Show(); folderCountNum.Enable(); sumSizeName.Show(); sumSizeName.Enable(); sumSizeNum.Show(); sumSizeNum.Enable(); badDirsName.Show(); badDirsName.Enable(); badDirsNum.Show(); badDirsNum.Enable(); lo.SetColGrowth( 3 ); lo.SetColGrowth( 0 ); this->AddLayout( &lo ); this->SetEnterCmd( CMD_OK ); SetPosition(); RefreshCounters(); }