Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
699 connectés 

  FORUM HardWare.fr
  Programmation
  C++

  Affichage d'info-bulles

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Affichage d'info-bulles

n°791470
choupinou
Posté le 09-07-2004 à 12:56:44  profilanswer
 

J'ai un controle CStatic (afficher du texte) et sur ce contrôle, j'autorise l'utilisateur à cliquer dessus. Ceci doit normalement permettre d'ouvrir une info-bulle mais je n'y arrive pas.
Pour l'instant voilà ce que j'ai écrit :

Code :
  1. void CInterface::Afficher_Info_Bulle(FURET* furet, CStatic *m_Ctrl_See_Furet)
  2. {
  3. CString temp;
  4. temp.Format("Identification : %s\nPoids : %f\nVolume : %s\nTest compound : %s\nDose : %s\nApplication mode : %s\nGroup : %d", furet->Caracteristiques.Identification, furet->Caracteristiques.Poids, furet->Caracteristiques.Volume,  furet->Caracteristiques.Test_Compound, furet->Caracteristiques.Dose, furet->Caracteristiques.Mode_Application, furet->Caracteristiques.Groupe);
  5. // AfxMessageBox(temp);
  6. CToolTipCtrl InfoBulle;
  7. InfoBulle.Create(NULL, TTS_ALWAYSTIP);
  8. InfoBulle.SetDelayTime(100);
  9. // InfoBulle.SetTipTextColor(ROUGE);
  10. InfoBulle.Activate(TRUE);
  11. // InfoBulle.Attach(m_Ctrl_See_Furet->m_hWnd);
  12. InfoBulle.BeginModalState();
  13. // InfoBulle.AnimateWindow(200, AW_SLIDE);
  14. InfoBulle.SetWindowText(temp);
  15. }

mood
Publicité
Posté le 09-07-2004 à 12:56:44  profilanswer
 

n°791479
masklinn
í dag viðrar vel til loftárása
Posté le 09-07-2004 à 13:05:53  profilanswer
 

Je code pas du tout en MFC perso, mais la logique ne voudrait elle pas que tu bind le texte avant de lancer le modal?
et MSDN me dit qu'il faut SetToolInfo(TOOLINFO lpToolInfo) pas SetWindowText (mais comme je l'ai dit je n'utilise pas les MFC)

n°791499
choupinou
Posté le 09-07-2004 à 13:33:58  profilanswer
 

Ca veut dire quoi que tu bind?
Pour le reste, c'est possible. Je vais essayer

n°791525
choupinou
Posté le 09-07-2004 à 14:08:03  profilanswer
 

J'ai essayé mais ça marche toujours pas. C'est le code que j'ai essayé :

Code :
  1. void CInterface::Afficher_Info_Bulle(FURET* furet, CStatic *m_Ctrl_See_Furet)
  2. {
  3. CString temp;
  4. temp.Format("Identification : %s\nPoids : %f\nVolume : %s\nTest compound : %s\nDose : %s\nApplication mode : %s\nGroup : %d", furet->Caracteristiques.Identification, furet->Caracteristiques.Poids, furet->Caracteristiques.Volume,  furet->Caracteristiques.Test_Compound, furet->Caracteristiques.Dose, furet->Caracteristiques.Mode_Application, furet->Caracteristiques.Groupe);
  5. // AfxMessageBox(temp);
  6. CToolTipCtrl InfoBulle;
  7. TOOLINFO ToolInfo;
  8. ToolInfo.hwnd=m_Ctrl_See_Furet->m_hWnd;
  9. ToolInfo.lpszText="Salut";
  10. ToolInfo.uFlags=TTF_ABSOLUTE | TTF_TRACK | TTF_IDISHWND;
  11. ToolInfo.uId=IDC_See_Furet_1;
  12. ToolInfo.rect.top=0;
  13. ToolInfo.rect.left=0;
  14. ToolInfo.rect.bottom=20;
  15. ToolInfo.rect.right=20;
  16. ToolInfo.cbSize=sizeof(TOOLINFO);
  17. InfoBulle.Create(NULL, TTS_ALWAYSTIP);
  18. // InfoBulle.SetDelayTime(100);
  19. // InfoBulle.SetTipTextColor(ROUGE);
  20. // InfoBulle.Activate(TRUE);
  21. // InfoBulle.Attach(m_Ctrl_See_Furet->m_hWnd);
  22. InfoBulle.SetToolInfo(&ToolInfo);
  23. InfoBulle.BeginModalState();
  24. // InfoBulle.AnimateWindow(200, AW_SLIDE);
  25. }

n°793202
choupinou
Posté le 12-07-2004 à 08:36:10  profilanswer
 

up

n°793213
jagstang
Pa Capona ಠ_ಠ
Posté le 12-07-2004 à 08:59:01  profilanswer
 

je connais pas les MFC. mais tu vas vraiment à tatons là... t'as pas de la doc / bouquin ?


---------------
What if I were smiling and running into your arms? Would you see then what I see now?  
n°793214
choupinou
Posté le 12-07-2004 à 09:00:15  profilanswer
 

Non justement et j'ai cherché dans la FAQ mais j'ai pas trouvé. Pour l'instant personne n'a réussi à m'aider

n°793218
jagstang
Pa Capona ಠ_ಠ
Posté le 12-07-2004 à 09:03:59  profilanswer
 

je vois merci


---------------
What if I were smiling and running into your arms? Would you see then what I see now?  
n°793220
jagstang
Pa Capona ಠ_ಠ
Posté le 12-07-2004 à 09:05:58  profilanswer
 

http://c.developpez.com/faq/vc/?page=ControlesDivers
http://www.codeguru.com/Cpp/contro [...] php/c2173/
http://www.codeproject.com/buttonc [...] button.asp
http://www.codeproject.com/miscctrl/tooltipzen.asp
 
tu devrais trouver ton bohneur


---------------
What if I were smiling and running into your arms? Would you see then what I see now?  
n°793222
choupinou
Posté le 12-07-2004 à 09:09:39  profilanswer
 

Merci

mood
Publicité
Posté le 12-07-2004 à 09:09:39  profilanswer
 

n°793346
choupinou
Posté le 12-07-2004 à 10:43:41  profilanswer
 

J'ai tout essayé mais rien ne s'affiche

n°793353
jagstang
Pa Capona ಠ_ಠ
Posté le 12-07-2004 à 10:48:01  profilanswer
 

ben zut alors


---------------
What if I were smiling and running into your arms? Would you see then what I see now?  
n°793357
choupinou
Posté le 12-07-2004 à 10:51:38  profilanswer
 

Hé ouais c'est chiant mais t'aurais pas une soluce

n°793362
jagstang
Pa Capona ಠ_ಠ
Posté le 12-07-2004 à 10:54:48  profilanswer
 

si. je t'en ai donné 4. si tu arrives pas avec ça je vois vraiment pas ce que je peux faire de plus.
 
tu te rends compte quand même que le problème vient d'ailleurs ?


---------------
What if I were smiling and running into your arms? Would you see then what I see now?  
n°794946
choupinou
Posté le 13-07-2004 à 17:07:09  profilanswer
 

Le problème vient bien apparemment d'ailleurs. J'utilise un timer (je dois le garder) et c'est peut-être celui-ci qui empêche l'affichage de l'info-bulle.
Il me faudrait dans ces cas là une solution qui permettrait d'afficher manuellement une info-bulle et qui resterait affichée tant que je ne décide pas de la détruire (au lieu d'un message de mouvement de la souris)

n°794948
choupinou
Posté le 13-07-2004 à 17:07:27  profilanswer
 

Au fait merci quand même pour ton aide


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  C++

  Affichage d'info-bulles

 

Sujets relatifs
Probleme affichage OpenGL avec MFCProblème d'affichage ( Rien ne s'affiche )
affichage d'informations dans un tabloAffichage dans fichier Excel : convertir les nombres en "texte"
[Info] Visual Studio 2005 ExpressQuestion bête à propos de l'affichage d'UNE seule news
comment limiter l'affichage d'un float...Pb avec l'affichage du nom et de la version d'un navigateur [Resolu]
[CSS] affichage d'une image au survol d'un texteNe pas sauter une ligne avant l'affichage d'une liste HTML
Plus de sujets relatifs à : Affichage d'info-bulles


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR