begin process at 2012 05 30 12:42:07
  Trouver un code source :
 
dans
 
Accueil > Forum > 

Archive C/C++

 > 

Archives

 > 

API

 > 

WxWidgets probleme de docking bar


Derniers messages déposésPoser une question dans le forum ou lancer une discussion

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,


Nos sponsors


Sondage...

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,312 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales