WxFTP ---> lister le repertoire distant dans un TextCtrl

Résolu
cs_satellite34 Messages postés 688 Date d'inscription mercredi 6 avril 2005 Statut Membre Dernière intervention 2 juin 2006 - 9 août 2005 à 01:21
cs_satellite34 Messages postés 688 Date d'inscription mercredi 6 avril 2005 Statut Membre Dernière intervention 2 juin 2006 - 8 sept. 2005 à 03:37
Bonjour,

J' essaye de développer une application client FTP sous wxWIDGETS en utilisant wxFTP;
Mon probléme c'est de lister le repertoire distant dans un wxTextCtrl;

code :

#include "FTPclientFrm.h"
#include "Connecter_XPM.xpm"


/*----------------------------------------------------------------------------
FTPclientFrm
----------------------------------------------------------------------------*/


BEGIN_EVENT_TABLE(FTPclientFrm,wxFrame)
EVT_CLOSE(FTPclientFrm::FTPclientFrmClose)
EVT_MENU(ID_MNU_CONNECT , FTPclientFrm::MnuConnectClick)
EVT_MENU(ID_MNU_DISCONNECT , FTPclientFrm::MnuDisconnectClick)
EVT_MENU(ID_CONNECTER, FTPclientFrm::ConnecterClick)
END_EVENT_TABLE()


FTPclientFrm::FTPclientFrm( wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style )
: wxFrame( parent, id, title, position, size, style)
{
CreateGUIControls();
}


FTPclientFrm::~FTPclientFrm() {}



IMPLEMENT_APP(FTPclientFrmApp)


bool FTPclientFrmApp::OnInit()
{
FTPclientFrm *myFrame = new FTPclientFrm(NULL);
SetTopWindow(myFrame);
myFrame->Show(TRUE);
return TRUE;
}

int FTPclientFrmApp::OnExit()
{
return 0;
}


void FTPclientFrm::CreateGUIControls()
{
MenuBar = new wxMenuBar( );
wxMenu *ID_MNU_FICHIER_Mnu_Obj = new wxMenu(0);
MenuBar->Append(ID_MNU_FICHIER_Mnu_Obj,_("Fichier"));

ID_MNU_FICHIER_Mnu_Obj->Append(ID_MNU_CONNECT,_("Connect"),_(""), wxITEM_NORMAL);

ID_MNU_FICHIER_Mnu_Obj->Append(ID_MNU_DISCONNECT,_("Disconnect"),_(""), wxITEM_NORMAL);


this->SetMenuBar(MenuBar);


ToolBar = new wxToolBar(this, ID_TOOLBAR , wxPoint(0,0),wxSize(-1,-1) );

Address = new wxStaticText(ToolBar, ID_STATICTEXT1 ,_("Address") ,wxPoint(0,0),wxSize(42,-1) );
ToolBar->AddControl(Address);


WxEditAddress = new wxTextCtrl(ToolBar, ID_WXEDITADDRESS, _("") , wxPoint(42,0),wxSize(121,-1) );
WxEditAddress->SetMaxLength(0);
ToolBar->AddControl(WxEditAddress);


User = new wxStaticText(ToolBar, ID_USER ,_("User") ,wxPoint(163,0),wxSize(26,-1) );
ToolBar->AddControl(User);


WxEditUser = new wxTextCtrl(ToolBar, ID_WXEDITUSER, _("") , wxPoint(189,0),wxSize(121,-1) );
WxEditUser->SetMaxLength(0);
ToolBar->AddControl(WxEditUser);


Password = new wxStaticText(ToolBar, ID_PASSWORD ,_("Password") ,wxPoint(310,0),wxSize(50,-1) );
ToolBar->AddControl(Password);


WxEditPassword = new wxTextCtrl(ToolBar, ID_WXEDITPASSWORD, _("") , wxPoint(360,0),wxSize(121,-1) );
WxEditPassword->SetMaxLength(0);
ToolBar->AddControl(WxEditPassword);


wxBitmap Connecter_BITMAP (Connecter_XPM);
wxBitmap Connecter_DISABLE_BITMAP (wxNullBitmap);
ToolBar->AddTool(ID_CONNECTER,_("Connecter"),Connecter_BITMAP , Connecter_DISABLE_BITMAP, wxITEM_NORMAL,_(""),_(""));


LocalSite = new wxTextCtrl(this, ID_LOCALSITE,"", wxPoint(6,241),wxSize(280,293) , wxTE_READONLY | wxTE_WORDWRAP);


DistantSite = new wxTextCtrl(this, ID_DISTANTSITE,"", wxPoint(294,241),wxSize(291,293) , wxTE_READONLY | wxTE_WORDWRAP);


Commandes = new wxTextCtrl(this, ID_COMMANDES,"", wxPoint(6,48),wxSize(578,182) , wxTE_READONLY | wxTE_WORDWRAP);


WxStatusBar1 = new wxStatusBar(this, ID_WXSTATUSBAR1 );


this->SetStatusBar(WxStatusBar1);
ToolBar->SetToolBitmapSize(wxSize(15,15));
ToolBar->Realize();
this->SetToolBar(ToolBar);
this->SetSize(8,8,601,607);
this->SetTitle(_("FTPclient"));
this->Center();
this->SetIcon(wxNullIcon);
////GUI Items Creation End
}


void FTPclientFrm::FTPclientFrmClose(wxCloseEvent& event)
{
Destroy();
}

void FTPclientFrm::ConnecterClick(wxCommandEvent& event)
{
MnuConnectClick(event);
}


/*-------------------------------------------------------------------------------
MnuConnectClick
-------------------------------------------------------------------------------*/


void FTPclientFrm::MnuConnectClick(wxCommandEvent& event)
{
wxString adresse = WxEditAddress->GetValue();
wxString utilisateur = WxEditUser->GetValue();
wxString passe = WxEditPassword->GetValue();

ftp = new wxFTP();

ftp->SetUser(utilisateur);
ftp->SetPassword(passe);

if ( !ftp->Connect(adresse) )
{
wxLogError("Connect n' a pas marché");
return;
}
wxMessageBox("vous etes connecté...", _T("Infos"), wxOK | wxICON_INFORMATION | wxCENTRE, this);

ftp->ChDir("/");


wxArrayString files;
if(!ftp->GetDirList(files, ""))
{
wxLogError("La liste n' est pas récupérée...");
return;
}
}


/*-------------------------------------------------------------------------------
MnuDisconnectClick
-------------------------------------------------------------------------------*/


void FTPclientFrm::MnuDisconnectClick(wxCommandEvent& event)
{
event.Skip();
}

Bon, j' ai tout mis pour que vous voyez la creation des gui controls pour :
wxString adresse = WxEditAddress->GetValue();
wxString utilisateur = WxEditUser->GetValue();
wxString passe = WxEditPassword->GetValue();

Je n'arrive pas a construire un wxSTRING avec la fonction GetDirList;
Pour écrire dans le textCtrl DistantSite (et les autre aussi), il me faut un wxSTRING!.
J' ai bien lu la documentation et honnetement je ne comprends pas.
Ils disent :


wxFTP::GetDirList

bool GetDirList(wxArrayString& files , const wxString& wildcard = "")
The GetList function is quite low-level. It returns the list of the files in the current directory. The list can be filtered using the wildcard string. If wildcard is empty (default), it will return all files in directory.
The form of the list can change from one peer system to another. For example, for a UNIX peer system, it will look like this:
-r--r--r-- 1 guilhem lavaux 12738 Jan 16 20:17 cmndata.cpp
-r--r--r-- 1 guilhem lavaux 10866 Jan 24 16:41 config.cpp
-rw-rw-rw- 1 guilhem lavaux 29967 Dec 21 19:17 cwlex_yy.c
-rw-rw-rw- 1 guilhem lavaux 14342 Jan 22 19:51 cwy_tab.c
-r--r--r-- 1 guilhem lavaux 13890 Jan 29 19:18 date.cpp
-r--r--r-- 1 guilhem lavaux 3989 Feb 8 19:18 datstrm.cpp


But on Windows system, it will look like this:


winamp~1 exe 520196 02-25-1999 19:28 winamp204.exe
1 file(s) 520 196 bytes


Return value: true if the file list was successfully retrieved, false otherwise.

Mais comment écrire ca dans dans un wxTextCtrl?
Merci pour votre aide.


Recherche entreprise développement à Montpellier pour BTS Informatique de Gestion en alternance............

10 réponses

fredcl Messages postés 547 Date d'inscription mercredi 8 janvier 2003 Statut Membre Dernière intervention 7 octobre 2007 1
9 août 2005 à 09:33
Bonjour,



je pense que ceci devrais répondre à ta question.



wxArrayString files;

if(!ftp->GetDirList(files, ""))

{

wxLogError("La liste n' est pas récupérée...");

return;

}

size_t numFiles = files.GetCount();



for (size_t i = 0; i < numFiles; i++)

{

// ne sachant pas dans quel wxTextCtrl tu voulais afficher j'pris un nom qui n'existais pas

// juste pour faire un exemple MonTextCtrl

// le wxTextCtrl devras avoir le style wxTE_MULTILINE pour afficher toutes les lignes

// le style wxTE_DONTWRAP serais aussi bien utile. Bien sur tu devras t'assurer que le wxTextCtrl

// est bien vide avant de le remplir en utilisant la fonction membre Clear()

MonTextCtrl->AppendText(files.Item(i));

MonTextCtrl->AppendText(_T("\r\n"));

// cette écriture devrais aussi être possible

// *MonTextCtrl << files.Item(i) << _T("\n");

}





A+



FredCL
3
fredcl Messages postés 547 Date d'inscription mercredi 8 janvier 2003 Statut Membre Dernière intervention 7 octobre 2007 1
6 sept. 2005 à 09:41
Bonjour,

Suite à ton mail, voici la fonction connect modifiée:

void FTPclientFrm::connect()
{
// VARS
wxString adresse = EditAddress->GetValue();
wxString utilisateur = EditUser->GetValue();
wxString passe = EditPassword->GetValue();
wxString directory = EditDir->GetValue();

if(!m_timer.IsRunning())
{
m_timer.Start(20000);
}
ftp->SetUser(utilisateur);
ftp->SetPassword(passe);
Commandes->AppendText("Connection.............................."
"Wait a second\n:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>\n");

if (!ftp->Connect(adresse))
{
result();
Commandes->AppendText("impossible de se connecter au serveur\n\nVeuillez vérifier l' adresse du serveur et"
" vos identifiants\nmerci\n");
return;
}
Commandes->AppendText(wxString::Format("Connecté à ")+adresse+(" dans ")+directory);
Commandes->AppendText("\n:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<<:<:<:<:<:<:<:<:<:<:<:<:<:<:<\n");

Commandes->AppendText("Commande : USER ");
Commandes->AppendText(utilisateur);
Commandes->AppendText("\n");
result();

StatusBar1->SetStatusText(wxString::Format("vous etes connecté à ")+utilisateur+("@")+adresse,0);

Commandes->AppendText("Commande : CWD ");
Commandes->AppendText(directory);
Commandes->AppendText("\n");
wxString msg;
msg.Printf(wxString::Format("cwd "+directory));
ftp->SendCommand(msg);
result();

Commandes->AppendText("Commande : TYPE I\n");
ftp->SendCommand("type i");
result();

Commandes->AppendText("Commande : SYST\n");
ftp->SendCommand("syst");
result();

// FredCL : Récupération du premier mot identifiant le système
wxString SysStr = ftp->GetLastResult().AfterFirst(' ').BeforeFirst(' ');
// FredCL : La chaine d'identification renvoyé, n'est pas la même pour
// tous les UNIX. IL faudrait vérifier que les format de la chaine pour
// les items est compatible avec tous les UNIX.
// if (ftp->GetLastResult()=="215 UNIX Type: L8")
if (SysStr == "UNIX")
{
DistantSite->ClearAll();
DistantSite->InsertColumn(0, _("nom"), wxLIST_FORMAT_LEFT, -1);
DistantSite->InsertColumn(1, _("type"), wxLIST_FORMAT_LEFT, -1);
DistantSite->InsertColumn(2, _("taille"), wxLIST_FORMAT_LEFT, -1);
// FredCL : J'ai supprimer une colonne car suivant les serveurs l'heure
// est parfois remplacer par l'année "Jan 05 2005" au lieu de "Sep 05 19:27"
// même taille mais format différent. Il faudrait passer cette chaine à une
// fonction d'analyse qui renverrais sous forme "05/01/2005 19:27" en mettant
// une date à 12:00 par exemple quand celle-ci n'est pas fourni
// Le client FTP LeechFTP fait comme celà
DistantSite->InsertColumn(3, _("date/heure"), wxLIST_FORMAT_LEFT, -1);
DistantSite->InsertColumn(4, _("permissions"), wxLIST_FORMAT_LEFT, -1);
//aidé par fredcl : http://www.cppfrance.com/forum.v2.aspx?ID=530582
wxArrayString dirs;
if(!ftp->GetDirList(dirs, ""))
{
Commandes->AppendText("impossible de récuperer la liste\n");
return;
}
size_t numFiles = dirs.GetCount();

// Inutile ClearAll a déjà effacé tous les items
// DistantSite->DeleteAllItems();

// Variables de traitement de la chaine de chaque item
wxString dirItems, tmp;
wxString name, type, size, date, attr;

for (size_t i =0; i<numFiles; i++)
{
dirItems = dirs.Item(i);
// drwxr-xr-x 1 ftp ftp 0 Sep 05 19:27 bin
// 01234567890123456789012345678901234567890123456789012345678901
// 1 2 3 4 5 6
// -r--r--r-- 1 guilhem lavaux 12738 Jan 16 20:17 cmndata.cpp

attr = dirItems.BeforeFirst(' ');
tmp = dirItems.AfterFirst(' ').Strip(wxString::leading);
type = tmp.BeforeFirst(' ');
tmp = tmp.AfterFirst(' ').Strip(wxString::leading);

tmp = tmp.AfterFirst(' ').Strip(wxString::leading);
tmp = tmp.AfterFirst(' ').Strip(wxString::leading);

size = tmp.BeforeFirst(' ');
tmp = tmp.AfterFirst(' ').Strip(wxString::leading);
date = tmp.Left(12);
name = tmp.Mid(13);

long m_count = DistantSite->GetItemCount();
// FredCL : le wxListCtrl ayant le style wxLC_SORT_ASCENDING
// il est nécessaire de récupérer l'index oû a été inséré l'item
m_count = DistantSite->InsertItem(m_count, name);
DistantSite->SetItem(m_count, 1, type);
DistantSite->SetItem(m_count, 2, size);
DistantSite->SetItem(m_count, 3, date);
DistantSite->SetItem(m_count, 4, attr);

// FredCL : ne semble pas nécessaire car le style du controle
// n'a pas été modifié
// DistantSite->UpdateStyle();
}
//fin de l' aide
result();
}

//if (ftp->GetLastResult()=="215 Windows_NT")
if (SysStr == "Windows_NT")
{
DistantSite->ClearAll();
DistantSite->InsertColumn(0,_("nom"),wxLIST_FORMAT_LEFT, -1);
DistantSite->InsertColumn(1,_("taille"),wxLIST_FORMAT_LEFT, -1);
DistantSite->InsertColumn(2,_("date"),wxLIST_FORMAT_LEFT, -1);
DistantSite->InsertColumn(3,_("heure"),wxLIST_FORMAT_LEFT, -1);

wxArrayString dirs;
if(!ftp->GetDirList(dirs, ""))
{
Commandes->AppendText("impossible de récuperer la liste\n");
return;
}
size_t numFiles = dirs.GetCount();

DistantSite->DeleteAllItems();

for (size_t i =0; i<numFiles; i++)
{
long m_count = DistantSite->GetItemCount();
// FredCL : le wxListCtrl ayant le style wxLC_SORT_ASCENDING
// il est nécessaire de récupérer l'index oû a été inséré l'item
m_count = DistantSite->InsertItem(m_count, dirs.Item(i).AfterLast(' '));

DistantSite->SetItem(m_count, 1, dirs.Item(i).AfterFirst(' ').substr(19, 10));
DistantSite->SetItem(m_count, 2, dirs.Item(i).BeforeLast(' ').substr(0, 10));
DistantSite->SetItem(m_count, 3, dirs.Item(i).BeforeLast(' ').substr(10, 14));
}
result();
}
}

J'ai regardé un peu ton programme. A mon avis tu devrais revoir l'interface qui n'est pas trés pratique.
Tu devrais essayer d'utiliser un wxDialog au lieu d'un wxFrame (Attention : la gestion est un peu différente, sur le site de wxWidgets c'est expliqué comment faire). De plus il serais bien que le répertoire local et le répertoire distant soit affiché de la même manière (L'ajout d'un glisser/déposer d'un répertoire à l'autre serais un plus)

Cordialement

FredCL
3
fredcl Messages postés 547 Date d'inscription mercredi 8 janvier 2003 Statut Membre Dernière intervention 7 octobre 2007 1
7 sept. 2005 à 17:16
Bonjour,

pour arriver à ça http://satellitesound.free.fr/capt.JPG enfin avec quelques petites chose en moins voici des extraits de code :

// Début : Extrait du fichier mainframe.h
class wxSplitterWindow;
class wxTreeCtrl;
class wxListCtrl;
class wxGenericDirCtrl;

#define MAIN_TITLE _("GUI Client FTP")

#define ID_FRAME_FTP 11000
#define ID_PANEL 11001
#define ID_ADDRESS 11002
#define ID_USER 11003
#define ID_PASSWORD 11004
#define ID_PORT 11005
#define ID_CONNECT 11006
#define ID_BASESPLITTER 11007
#define ID_LOCAL_PANEL 11008
#define ID_LOCAL_HISTORY 11009
#define ID_LOCALSPLITTER 11010
#define ID_LOCAL_TREE 11011
#define ID_LOCAL_LIST 11012
#define ID_REMOTE_PANEL 11013
#define ID_REMOTE_HISTORY 11014
#define ID_REMOTE_FILES 11015

#define ID_MENU 12001
#define ID_MENUITEM 12002
#define ID_MENUITEM1 12003

class wxMainFrame: public wxFrame
{
DECLARE_CLASS(wxMainFrame)
DECLARE_EVENT_TABLE()

public:

wxMainFrame();
wxMainFrame(wxWindow* parent, wxWindowID id = ID_FRAME_FTP,
const wxString& caption = MAIN_TITLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE);

bool Create(wxWindow* parent, wxWindowID id = ID_FRAME_FTP,
const wxString& caption = MAIN_TITLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE);

protected:

void CreateMenu();
void CreateControls();

private:

wxTextCtrl* edAddress;
wxTextCtrl* edUser;
wxTextCtrl* edPassWord;
wxTextCtrl* edPort;
wxSplitterWindow* baseSplitter;
wxPanel* localPanel;
wxComboBox* localHistory;
wxGenericDirCtrl* localTreeCtrl;
wxListCtrl* localListCtrl;
wxPanel* remotePanel;
wxComboBox* remoteHistory;
wxListCtrl* remoteListCtrl;
};
// fin : Extrait du fichier mainframe.h

// Début : Extrait du fichier mainframe.cpp
bool wxMainFrame::Create(wxWindow* parent, wxWindowID id,
const wxString& caption, const wxPoint& pos,
const wxSize& size, long style)
{
edAddress = NULL;
edUser = NULL;
edPassWord = NULL;
edPort = NULL;
baseSplitter = NULL;
localPanel = NULL;
localHistory = NULL;
localTreeCtrl = NULL;
localListCtrl = NULL;
remotePanel = NULL;
remoteHistory = NULL;
remoteListCtrl = NULL;

wxFrame::Create(parent, id, caption, pos, size, style);

CreateMenu();
CreateControls();
return TRUE;
}

void wxMainFrame::CreateMenu()
{
wxMenuBar* menuBar = new wxMenuBar;
wxMenu* Menu1 = new wxMenu;
Menu1->Append(ID_MENU, _("Item"), _T(""), wxITEM_NORMAL);
Menu1->Append(ID_MENUITEM, _("Item"), _T(""), wxITEM_NORMAL);
menuBar->Append(Menu1, _("Menu"));
wxMenu* Menu2 = new wxMenu;
Menu2->Append(ID_MENUITEM1, _("Item"), _T(""), wxITEM_NORMAL);
menuBar->Append(Menu2, _("Menu"));
SetMenuBar(menuBar);
}

void wxMainFrame::CreateControls()
{
wxBoxSizer* bSizer1 = new wxBoxSizer(wxVERTICAL);
SetSizer(bSizer1);

wxPanel* toolsPanel = new wxPanel(this, ID_PANEL, wxDefaultPosition,
wxDefaultSize,
wxSUNKEN_BORDER|wxTAB_TRAVERSAL);
bSizer1->Add(toolsPanel, 0, wxGROW, 0);

wxBoxSizer* bSizer2 = new wxBoxSizer(wxHORIZONTAL);
toolsPanel->SetSizer(bSizer2);

wxStaticText* iStatic1 = new wxStaticText(toolsPanel, wxID_STATIC,
_("Address :"), wxDefaultPosition,
wxDefaultSize, 0);
bSizer2->Add(iStatic1, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);

edAddress = new wxTextCtrl(toolsPanel, ID_ADDRESS, wxEmptyString,
wxDefaultPosition, wxDefaultSize, 0);
bSizer2->Add(edAddress, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

wxStaticText* iStatic2 = new wxStaticText(toolsPanel, wxID_STATIC,
_("User :"), wxDefaultPosition,
wxDefaultSize, 0);
bSizer2->Add(iStatic2, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);

edUser = new wxTextCtrl(toolsPanel, ID_USER, wxEmptyString,
wxDefaultPosition, wxDefaultSize, 0);
bSizer2->Add(edUser, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

wxStaticText* iStatic3 = new wxStaticText(toolsPanel, wxID_STATIC,
_("Password :"), wxDefaultPosition,
wxDefaultSize, 0);
bSizer2->Add(iStatic3, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);

edPassWord = new wxTextCtrl(toolsPanel, ID_PASSWORD, wxEmptyString,
wxDefaultPosition, wxDefaultSize, 0);
bSizer2->Add(edPassWord, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

wxStaticText* iStatic4 = new wxStaticText(toolsPanel, wxID_STATIC,
_("Port :"), wxDefaultPosition,
wxDefaultSize, 0);
bSizer2->Add(iStatic4, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);

edPort = new wxTextCtrl(toolsPanel, ID_PORT, _("21"), wxDefaultPosition,
wxSize(40, -1), 0);
bSizer2->Add(edPort, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

bSizer2->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

wxButton* btnConnect = new wxButton(toolsPanel, ID_CONNECT,
_("Quick connect"), wxDefaultPosition,
wxDefaultSize, 0);
bSizer2->Add(btnConnect, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

baseSplitter = new wxSplitterWindow(this, ID_BASESPLITTER, wxDefaultPosition,
wxSize(100, 100),
wxSP_3DBORDER|wxSP_3DSASH|wxNO_BORDER);
baseSplitter->SetMinimumPaneSize(20);

localPanel = new wxPanel(baseSplitter, ID_LOCAL_PANEL, wxDefaultPosition,
wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL);
wxBoxSizer* bSizer3 = new wxBoxSizer(wxVERTICAL);
localPanel->SetSizer(bSizer3);

wxBoxSizer* bSizer4 = new wxBoxSizer(wxHORIZONTAL);
bSizer3->Add(bSizer4, 0, wxGROW, 0);
wxStaticText* iStatic5 = new wxStaticText(localPanel, wxID_STATIC,
_("Local site : "),
wxDefaultPosition, wxDefaultSize, 0);
bSizer4->Add(iStatic5, 0, wxALIGN_CENTER_VERTICAL|wxADJUST_MINSIZE, 0);

localHistory = new wxComboBox(localPanel, ID_LOCAL_HISTORY, wxEmptyString,
wxDefaultPosition, wxDefaultSize, 0, NULL,
wxCB_DROPDOWN);
bSizer4->Add(localHistory, 1, wxALIGN_CENTER_VERTICAL, 0);

wxSplitterWindow* localSplitter = new wxSplitterWindow(localPanel,
ID_LOCALSPLITTER,
wxDefaultPosition,
wxSize(100, 100),
wxSP_3DBORDER|wxSP_3DSASH|wxNO_BORDER);
localSplitter->SetMinimumPaneSize(20);
localTreeCtrl = new wxGenericDirCtrl(localSplitter, ID_LOCAL_TREE, wxEmptyString,
wxDefaultPosition, wxDefaultSize,
wxDIRCTRL_DIR_ONLY|wxSUNKEN_BORDER,
_("All files (*.*)|*.*"), 0);


localListCtrl = new wxListCtrl(localSplitter, ID_LOCAL_LIST,
wxDefaultPosition, wxDefaultSize, wxLC_REPORT);

localSplitter->SplitHorizontally(localTreeCtrl, localListCtrl, 0);
bSizer3->Add(localSplitter, 1, wxGROW, 0);

remotePanel = new wxPanel(baseSplitter, ID_REMOTE_PANEL, wxDefaultPosition,
wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL);
wxBoxSizer* bSizer5 = new wxBoxSizer(wxVERTICAL);
remotePanel->SetSizer(bSizer5);

wxBoxSizer* bSizer6 = new wxBoxSizer(wxHORIZONTAL);
bSizer5->Add(bSizer6, 0, wxGROW, 0);
wxStaticText* iStatic6 = new wxStaticText(remotePanel, wxID_STATIC,
_("Remote site : "),
wxDefaultPosition, wxDefaultSize, 0);
bSizer6->Add(iStatic6, 0, wxALIGN_CENTER_VERTICAL|wxADJUST_MINSIZE, 0);

remoteHistory = new wxComboBox(remotePanel, ID_REMOTE_HISTORY, wxEmptyString,
wxDefaultPosition, wxDefaultSize, 0, NULL,
wxCB_DROPDOWN);
bSizer6->Add(remoteHistory, 1, wxALIGN_CENTER_VERTICAL, 0);

remoteListCtrl = new wxListCtrl(remotePanel, ID_REMOTE_FILES,
wxDefaultPosition, wxDefaultSize, wxLC_REPORT);
bSizer5->Add(remoteListCtrl, 1, wxGROW, 0);

baseSplitter->SplitVertically(localPanel, remotePanel, 0);
bSizer1->Add(baseSplitter, 1, wxGROW, 0);
}
// fin : Extrait du fichier mainframe.cpp

Cordialement

FredCL
3
cs_satellite34 Messages postés 688 Date d'inscription mercredi 6 avril 2005 Statut Membre Dernière intervention 2 juin 2006 1
9 août 2005 à 12:08
Merci beaucoup fred !

super, ca marche à merveille!!!!!!!


Recherche entreprise développement à Montpellier pour BTS Informatique de Gestion en alternance............
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
cs_satellite34 Messages postés 688 Date d'inscription mercredi 6 avril 2005 Statut Membre Dernière intervention 2 juin 2006 1
6 sept. 2005 à 10:16
Bonjour,

Ben vraiment, je te remercie beaucoup:
C'est trés simpa d' avoir apporté ta pierre;

Pour l' interface, j' ai déja commencé, en fait au début je voulais tester wxFTP, donc pas développé l'interface;
Aujourdhui le programme est sizé;

Hum, pour le repertoire distant moi j' aime bien les colonnes, ca fait un peu a la file zilla et c'est cool;
Que m' apporterai l' utilisation d' un wxDialog a la place d' un wxFrame sachant que je crois bien que dans wxDialog , je peux pas mettre de menu;

voila, si tu veux suivre l' avancée de ce dev http://satellitesound/binFTP.rar pour les binnaires, http://satellitesound/Clientftp.rar pour tout!
Erf, les fonctions ne sont pas ncore implémentées mais ca a deja une otre gueulle;

Sinon, dans mon wxGenericDirCtrl, je voudrai appeller un evenement sur clik droit sur un item, doit-je creer une classe obligatoirement pour
appeller un evenement de souris????

Je débute en prog et faire communiquer deux classe est pour moi encore assez abstrait;


event.Merci();
@+;
ROOT_DIEU Alias satellite34
0
cs_satellite34 Messages postés 688 Date d'inscription mercredi 6 avril 2005 Statut Membre Dernière intervention 2 juin 2006 1
6 sept. 2005 à 10:18
http://satellitesound.free.fr/binFTP.rar
http://satellitesound.free.fr/Clientftp.rar

désolé

event.Merci();
@+;
ROOT_DIEU Alias satellite34
0
fredcl Messages postés 547 Date d'inscription mercredi 8 janvier 2003 Statut Membre Dernière intervention 7 octobre 2007 1
6 sept. 2005 à 11:10
L'utilisation d'un wxDialog permet une meilleur navigation entre les controles

Cordialement

FredCL
0
cs_satellite34 Messages postés 688 Date d'inscription mercredi 6 avril 2005 Statut Membre Dernière intervention 2 juin 2006 1
6 sept. 2005 à 12:20
re,
en fait, ce qui serait au top a mon gout, pour l' ergonomie et l' apparence de mon programme, ce serait que l' utilisateur puisse déterminer la taille de chacune des trois "zones" de la frame; je met une capture car ca n' a pas l' air trés clair;

http://satellitesound.free.fr/capt.JPG
voila, en fait , je voudrai bien ariiver a ce résultat;

Dois-je creer des windows ou des dialogs dans ma frame??? avec un style spécial???

En gros, il me faudrai la stratégie pour arriver à ce résultat....

Merci;
@+
ROOT_DIEU
0
cs_satellite34 Messages postés 688 Date d'inscription mercredi 6 avril 2005 Statut Membre Dernière intervention 2 juin 2006 1
7 sept. 2005 à 05:51
Bonjour;

ceci ne seerait pas mon bonheur???

http://www.anthemion.co.uk/wxworkshop/docs/html/fl/fl66.htm#wxframelayoutwxframelayout


event.Merci();
@+;
ROOT_DIEU Alias satellite34
0
cs_satellite34 Messages postés 688 Date d'inscription mercredi 6 avril 2005 Statut Membre Dernière intervention 2 juin 2006 1
8 sept. 2005 à 03:37
Franchement,

Je te tire ma casquette;
C'est magnifique;

Maintenant, je vais le faire moi-même, pour bien tout comprendre car c' est clair que de suite ca fait pro ;-)
Et c' est la base d' une appli qui tient la route;
Et puis, quel support!!!!!!

Encore une fois Merci, c' est vraiment exellent;

fredCL est un BOSS


event.Merci();
@+;
ROOT_DIEU Alias satellite34
0
Rejoignez-nous