Accueil > Forum > > > > WxWidgets probleme de docking bar
WxWidgets probleme de docking bar
mercredi 29 mars 2006 à 11:03:53 |
WxWidgets probleme de docking bar

zaibacker
|
Bonjour, j'ai un souci au moment où je dois inserer la docking/floating bar dans un projet. Cette docking bar ne devient visible et surtout ne peut etre utilisée que lorsque je reduis la fenetre principale ( et non pas dès le lancement de l'application). Par ailleur ,une fois qu'elle fonctionne elle prend la couleur de la fenetre principal,d'un point de vue ergonomique ca fait très moche.
J'ai deja utilise la methode Refresh() mais sans grand resultat.
Voici un bout du code :
wxFrameLayout * mpLayout = new wxFrameLayout(this,this->pPanelMap );
mpLayout->SetUpdatesManager( new cbGCUpdatesMgr() );
// setup plugins for testing
mpLayout->PushDefaultPlugins();
mpLayout->AddPlugin( CLASSINFO( cbBarHintsPlugin ) );
mpLayout->AddPlugin( CLASSINFO( cbHintAnimationPlugin ) );
mpLayout->AddPlugin( CLASSINFO( cbRowDragPlugin ) );
mpLayout->AddPlugin( CLASSINFO( cbAntiflickerPlugin ) );
mpLayout->AddPlugin( CLASSINFO( cbSimpleCustomizationPlugin ) );
wxPanel * pPanel = new wxPanel((wxWindow*)this);
wxButton * _bBoton = new wxButton();
_bBoton->Create(pPanel, -1,wxT( "salut"));
cbDimInfo sizes2( 300,35, // when docked horizontally
300,35, // when docked vertically
300,35, // when floated
TRUE, // the bar is not fixed-size
4, // vertical gap (bar border)
4, // horizontal gap (bar border)
new cbDynToolBarDimHandler()
);
mpLayout->AddBar( pPanel, // bar window (can be NULL)
sizes2, FL_ALIGN_TOP, // alignment ( 0-top,1-bottom, etc)
50, // insert into 0th row (vert. position)
50, // offset from the start of row (in pixels)
_T( "ToolBar2"), // name for reference in customization pop-ups
FALSE
);
mpLayout->ShowFloatedWindows( true);
mpLayout->Activate();
mpLayout->RefreshNow(true);
Merci
|
|
mercredi 29 mars 2006 à 14:27:44 |
Re : WxWidgets probleme de docking bar

satellite34
|
wxPanel * pClientPanel = new wxPanel((wxWindow*)this); // lui, c'est le client wxPanel *wxPanelMap = new wxPanel( this ); // lui c'est une bar wxFrameLayout * mpLayout = new wxFrameLayout(this, pClientPanel );
mpLayout->SetUpdatesManager( new cbGCUpdatesMgr() );
// setup plugins for testing
mpLayout->PushDefaultPlugins();
mpLayout->AddPlugin( CLASSINFO( cbBarHintsPlugin ) );
mpLayout->AddPlugin( CLASSINFO( cbHintAnimationPlugin ) );
mpLayout->AddPlugin( CLASSINFO( cbRowDragPlugin ) );
mpLayout->AddPlugin( CLASSINFO( cbAntiflickerPlugin ) );
mpLayout->AddPlugin( CLASSINFO( cbSimpleCustomizationPlugin ) );
wxButton * _bBoton = new wxButton();
_bBoton->Create(pPanelMap, -1,wxT("salut"));
cbDimInfo sizes2( 300,35, // when docked horizontally
300,35, // when docked vertically
300,35, // when floated
TRUE, // the bar is not fixed-size
4, // vertical gap (bar border)
4, // horizontal gap (bar border)
new cbDynToolBarDimHandler()
);
mpLayout->AddBar(pPanelMap, // bar window (can be NULL)
sizes2, FL_ALIGN_TOP, // alignment ( 0-top,1-bottom, etc)
50, // insert into 0th row (vert. position)
50, // offset from the start of row (in pixels)
_T("ToolBar2"), // name for reference in customization pop-ups
FALSE
);
#ifdef __WXGTK__
m_pLayout->EnableFloating( true );
#endif
m_pLayout->RefreshNow();
voila, j'ai pas le temps de faire plus, je dois partir o boulot, dis moi si ca marche, sinon, je regarderai mieu ce soir; @+; satellite34
http://www.rootscommunity.com/
|
|
mercredi 29 mars 2006 à 17:34:05 |
Re : WxWidgets probleme de docking bar

zaibacker
|
salut,
ton wxPanel * pClientPanel = new wxPanel((wxWindow*)this); // lui, c'est le client , représente mon pPanelMap qui est une wxPanel déjà implementé mais dont le code est bcp trop gros pour etre afficher.
ton wxPanel *wxPanelMap = new wxPanel( this ); // lui c'est une bar ca correspond à mon wxPanel * pPanel = new wxPanel((wxWindow*)this);
pour que tu ai une idee de ce quil maffiche faudrait vraiment que je te fasse des imprimes ecran.
je te remercie
|
|
mercredi 29 mars 2006 à 19:28:09 |
Re : WxWidgets probleme de docking bar

satellite34
|
re, donc, pour les docbars il faut un wxWindow client qui sert juste a recevoir les dockbars; tu creer un panel qui sera ton client de la frameLayout, et ensuite, tu fais des AddBar le probleme dans ton code c'est que le client est aussi une bar, tu vois ce que je veux dire???? regarde ma source, le fichier FTPclientFrm.cpp a la ligne 193, tu vas de suite comprendre; Si t'y arrives toujours pas, je tenterai de coder ton layout, mais il me faudra le fichier; verra ca aprés, avec mon exemple tu devrai t'en sortir
@+; satellite34
http://www.rootscommunity.com/
|
|
jeudi 30 mars 2006 à 11:37:41 |
Re : WxWidgets probleme de docking bar

zaibacker
|
resalut, je vois ce que tu fais dans ton clientftp mais en faite chez moi le client est un panel qui affiche une carte. Mon code en entier du .cpp en question est celui-ci
// -*- C++ -*- generated by wxGlade 0.4 on Thu Feb 09 13:55:31 2006
#include "EnebroFrame.h"
/*******************/
#include "wx/fl/controlbar.h"
#include "wx/fl/toolwnd.h"
#include "wx/fl/barhintspl.h" // bevel for bars with "X"s and grooves
#include "wx/fl/rowdragpl.h" // NC-look with draggable rows
#include "wx/fl/cbcustom.h" // customization plugin
#include "wx/fl/hintanimpl.h" // beauty-care
#include "wx/fl/gcupdatesmgr.h" // smooth d&d
#include "wx/fl/antiflickpl.h" // double-buffered repaint of decorations
#include "wx/fl/dyntbar.h" // auto-layout toolbar
#include "wx/fl/dyntbarhnd.h" // control-bar dimension handler for it
/********************/
EnebroFrame::EnebroFrame(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
wxFrame(parent, id, title, pos, size, wxCAPTION|wxCLOSE_BOX|wxMINIMIZE_BOX|wxMAXIMIZE|wxMAXIMIZE_BOX|wxSYSTEM_MENU|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN)
{
this->pPanelMap= new PanelMapa(this);
if (!this->pPanelMap)
{
wxMessageBox(wxT( "No ha sido posible cargar el panel."));
exit (1);
}
set_properties();
do_layout();
/************************************************************/
wxFrameLayout * mpLayout = new wxFrameLayout(this,this->pPanelMap /*mpClientWnd*/);
mpLayout->SetUpdatesManager( new cbGCUpdatesMgr() );
// setup plugins for testing
mpLayout->PushDefaultPlugins();
mpLayout->AddPlugin( CLASSINFO( cbBarHintsPlugin ) ); // fancy "X"es and bevel for bars
mpLayout->AddPlugin( CLASSINFO( cbHintAnimationPlugin ) );
mpLayout->AddPlugin( CLASSINFO( cbRowDragPlugin ) );
mpLayout->AddPlugin( CLASSINFO( cbAntiflickerPlugin ) );
mpLayout->AddPlugin( CLASSINFO( cbSimpleCustomizationPlugin ) );
wxPanel * pPanel = new wxPanel((wxWindow*)this);
wxButton * _bBoton = new wxButton();
_bBoton->Create(pPanel, -1,wxT( "hola"));
cbDimInfo sizes2( 300,35, // when docked horizontally
500,90, // when docked vertically
500,35, // when floated
TRUE, // the bar is not fixed-size
4, // vertical gap (bar border)
4, // horizontal gap (bar border)
new cbDynToolBarDimHandler()
);
mpLayout->AddBar( /*pToolBar*/pPanel, // bar window (can be NULL)
sizes2, FL_ALIGN_TOP, // alignment ( 0-top,1-bottom, etc)
50, // insert into 0th row (vert. position)
50, // offset from the start of row (in pixels)
_T( "ToolBar2"), // name for reference in customization pop-ups
FALSE
);
#ifdef __WXGTK__
mpLayout->EnableFloating( true );
#endif
/****************************************************************/
this->pPanelMap->Inicializa();
this->pPanelMap->Carga();
this->pPanelMap->SetAutoLayout( true);
mpLayout->ShowFloatedWindows( true);
mpLayout->RefreshNow(true);
}
void EnebroFrame::set_properties()
{
SetTitle(_( "Enebro"));
wxIcon _icon;
_icon.CopyFromBitmap(wxBitmap(wxT( "ico/enebro.bmp"), wxBITMAP_TYPE_ANY));
SetIcon(_icon);
SetBackgroundColour(wxColour(255, 255, 255));
}
void EnebroFrame::do_layout()
{
wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
sizer->Add( this->pPanelMap, 1, wxEXPAND, 0);
SetAutoLayout( true);
SetSizer(sizer);
Layout();
Centre();
// end wxGlade
}
void EnebroFrame::OnZoomExtension(wxCommandEvent& event)
{
if ( pPanelMap == NULL ) return;
pPanelMap->ExtensionTotal();
}
void EnebroFrame::OnZoomAcercar(wxCommandEvent& event)
{
if ( pPanelMap == NULL ) return;
pPanelMap->Acercar();
}
void EnebroFrame::OnZoomAlejar(wxCommandEvent& event)
{
if ( pPanelMap == NULL ) return;
pPanelMap->Alejar();
}
void EnebroFrame::OnDesplazar(wxCommandEvent& event)
{
if ( pPanelMap == NULL ) return;
pPanelMap->Desplazar();
}
void EnebroFrame::OnLimpiar(wxCommandEvent& event)
{
if ( pPanelMap == NULL ) return;
pPanelMap->Limpiar();
}
void EnebroFrame::OnCargar(wxCommandEvent& event)
{
if ( pPanelMap == NULL ) return;
wxString titulo(wxT( "Carga de capas"));
pPanelMap->CargarCapa( this, titulo);
}
void EnebroFrame::OnZoomVentana(wxCommandEvent& event)
{
if ( pPanelMap == NULL ) return;
pPanelMap->ZoomVentana();
}
void EnebroFrame::AddEvent( int id_evento,
wxEventType evt_type,
wxObjectEventFunction evt_func)
{
this->Connect(id_evento,evt_type,evt_func);
}
void EnebroFrame::AddEvent( wxEventType evt_type,
wxObjectEventFunction evt_func)
{
this->Connect(evt_type,evt_func);
}
|
|
jeudi 30 mars 2006 à 22:31:11 |
Re : WxWidgets probleme de docking bar

satellite34
|
Essaye voir de mettre en client un wxPanel vierge de tous controles. Ca devrait marcher sans problemes, c'est un peu bizzare je l'avoue mais quand ca marche tu comprends de suite comment la lib fonctionne. En fait ce panel ne sert qu'a intercepter les events de la lib et a avoir une surface sur laquelle docker j'ai eu le meme soucis que toi et résolu comme ca, sinon, ton code est bien, il te faut juste un client valide.
@+; satellite34
http://www.rootscommunity.com/
|
|
Cette discussion est classée dans : bar, mplayout, addplugin, classinfo, docking
Répondre à ce message
Sujets en rapport avec ce message
pb de progress bar en visual c++ [ par glipper ]
Voila je debute en programmation visual c++ et je n'arrive pas à faire marcher une progress bar. J'arrive à la faire apparaitre dans ma boite de dialo
la class de progressbar marche comment ??? [ par Xs ]
salut !!!je ne sais plus qui, mais quelqu'un a déposé une source pour la progress bar : comment s'en sert-on passke ca fait je sais pas combien de foi
progress bar [ par yangan ]
Comment marche une progress bar en c++ sous visual(avec mfc)?
URGENT-vc++ [ par yangan ]
G deux petits problèmes sou vc++ et ça devient très urgent!1-comment faire un progress bar inversé cad comment faire pour qu'il avance de droite à gau
Progress Bar [ par thebigbang ]
Bonjour,Comment faire pour insérer une progress bar dans un projet VC++ ?J'ai essayé d'en déposer une sur la fenetre mais lorsque je compile, rien ne
Problème scroll bar [ par lma ]
Je souhaite integrer une scroll bar pour faire varier une valeur.Quand je bouge le curseur avec la souris çà marche mais quand j'appuie sur les bouton
Progress Bar [ par LordBob ]
Bonjour a tous,moi je voudrai juste savoir comment on fait pour remplir une progress bar... merci d'avance...
status bar et progress bar (win32) [ par Elendal ]
J'ai créé une status Bar en deux parties.Dans la première partie, j'affiche du texte. Là pas de problème.Dans la deuxième par contre, je voudrais mett
Slider bar en API Win32 [ par sebseb42 ]
voila, j'utilise un controle Slider dans une fenetre que je gere en API Win32 (pas de MFC)je voudrais definir sa position initial, pour placer ;e curs
Pb débit USB / affichage progress bar [ par goondy ]
Bon, soyons concis et précis!Je veux transférer des fichiers sur mon baladeur mp3, c'est comme une clé usb.Pour copier : j'ai utilisé SHFileOperation,
Livres en rapport
|
Derniers Blogs
POUR RAPPEL ! LES SPéCIFICATIONS DES PROTOCOLES OFFICE ET SHAREPOINT SONT DISPONIBLES SUR MSDNPOUR RAPPEL ! LES SPéCIFICATIONS DES PROTOCOLES OFFICE ET SHAREPOINT SONT DISPONIBLES SUR MSDN par neodante
Quelle est le point commun entre : Microsoft il y a 10 ans et Apple aujourd'hui ? Réponse: avoir une politique de protocoles propriétaires et fermés :) Car pour rappel (si si je vous assure c'est important de le rappeler), la majorité des spécifications e...
Cliquez pour lire la suite de l'article par neodante JOYEUX ANNIVERSAIRE NIXJOYEUX ANNIVERSAIRE NIX par ebartsoft
Souhaitons un bon et joyeux anniversaire à notre hôte à tous, Nix.
Je ne le répéterais jamais assez mais sans lui rien ne serait possible. Il défit en permanence les lois de la gravité et comme il le dit si bien, si tu lui fais confiance ça devra...
Cliquez pour lire la suite de l'article par ebartsoft IMAGINE CUP 2012, MAKE A SIGN EN FINALEIMAGINE CUP 2012, MAKE A SIGN EN FINALE par junarnoalg
Voilà qui est fait, la nouvelle est officielle ! L'équipe belge "Make a Sign" va au pays des kangourous défendre son projet dans la catégorie Software Design. http://www.imaginecup.com/CompetitionsContent/Competition/WorldwideFinalists.aspx V...
Cliquez pour lire la suite de l'article par junarnoalg KINECT 1.5 IS OUT !KINECT 1.5 IS OUT ! par Vko
La version 1.5 du Kinect For Microsoft vient tout juste de sortir ! Plein de nouveautés: Tracking de squelette en Near Mode Détection en position assise Détection faciale avec un SDK dédié Documentation et des guideline (enfin) Un out...
Cliquez pour lire la suite de l'article par Vko LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) par richardc
Mise à jour des Web API du 14 Mai
Réservez dès maintenant votre journée du 20 juin pour le Windows Azure Dev Camp 2012 à Paris
Mise à jour de Team Foundation Service
MechCommander 2 sur Windows 8
Entity Framework 5 Release Candidate e...
Cliquez pour lire la suite de l'article par richardc
Forum
MATLAB PROGRAMME MATLAB PROGRAMME par wahab1087
Cliquez pour lire la suite par wahab1087 RGB2GRAYRGB2GRAY par musa18
Cliquez pour lire la suite par musa18
Logiciels
sDEVIS-FACTURES vlPRO (8.1.0.3)SDEVIS-FACTURES VLPRO (8.1.0.3)sDEVIS-FACTURES vlPRO a été mis au point pour les particuliers, créateurs, entrepreneurs, artisa... Cliquez pour télécharger sDEVIS-FACTURES vlPRO 974 Application Server (12.2.4.6)974 APPLICATION SERVER (12.2.4.6)Développez de puissantes applications dans un environnement de 'cloud computing', clusterisé, séc... Cliquez pour télécharger 974 Application Server vPicture (1.4.2.1)VPICTURE (1.4.2.1)Avec vPicture, hébergez vos images facilement et rapidement.
vPicture est un utilitaire simple, ... Cliquez pour télécharger vPicture Easy-Planning (2.2.1.6)EASY-PLANNING (2.2.1.6)Easy-Planning permet de créer des plannings sous la représentation de diagrammes et est adapté au... Cliquez pour télécharger Easy-Planning COM-BACKUP (2.0)COM-BACKUP (2.0)
COM-BACKUP est un logiciel de sauvegarde qui permet de planifier les sauvegardes de vos dossiers ...
Cliquez pour télécharger COM-BACKUP
|