Visualizzazione dei risultati da 1 a 6 su 6
  1. #1
    Utente di HTML.it L'avatar di Aki
    Registrato dal
    Dec 2002
    Messaggi
    2,206

    [C++/wxWindows]wxTextCtrl: impostare grandezza

    saluti a todos
    ho trovato su questoi sito il codice x creare un controllo di testo con C++/wxWindows;
    ma nell'esempio mette DefaultSize che prende tutto lo spazio, come si fà quindi a impostargli valori fissi x altezza e larghezza?
    io ho provato così (in bold ciò che ho modificato):
    codice:
    {
      theText = (wxTextCtrl *) NULL;
    
      theText 
       = new wxTextCtrl
      	( this,
      	  -1,
      	  wxString("Insert here your text"),
    	  wxDefaultPosition,
    	  50, 10,
    	  wxTE_MULTILINE
    	);  
    }
    ma dà errore:
    assassin.cpp: In constructor `BasicFrame::BasicFrame(const wxChar*, int, int, int, int)':
    assassin.cpp:37: error: no matching function for call to `wxTextCtrl::wxTextCtrl(BasicFrame* const, int, wxString, const wxPoint&, int, int, int)'
    ..\..\Include\wx\msw\textctrl.h:258: note: candidates are: wxTextCtrl::wxTextCtrl(const wxTextCtrl&)
    ..\..\Include\wx\msw\textctrl.h:33: note: wxTextCtrl::wxTextCtrl(wxWindow*, wxWindowID, const wxString&, const wxPoint&, const wxSize&, long int, const wxValidator&, const wxString&)
    ..\..\Include\wx\msw\textctrl.h:25: note: wxTextCtrl::wxTextCtrl()
    cosa sbaglio?

  2. #2
    Utente di HTML.it L'avatar di anx721
    Registrato dal
    Apr 2003
    Messaggi
    2,352
    Prova a sostituire 50, 10 con wxSize(50, 10):

    codice:
    {
      theText = (wxTextCtrl *) NULL;
    
      theText 
       = new wxTextCtrl
      	( this,
      	  -1,
      	  wxString("Insert here your text"),
    	  wxDefaultPosition,
    	  wxSize(50, 10),
    	  wxTE_MULTILINE
    	);  
    }

    Sun Certified Java Programmer

    EUCIP Core Level Certified

    European Certification of Informatics Professionals

  3. #3
    Utente di HTML.it L'avatar di Aki
    Registrato dal
    Dec 2002
    Messaggi
    2,206
    Originariamente inviato da anx721
    Prova a sostituire 50, 10 con wxSize(50, 10):

    codice:
    {
      theText = (wxTextCtrl *) NULL;
    
      theText 
       = new wxTextCtrl
      	( this,
      	  -1,
      	  wxString("Insert here your text"),
    	  wxDefaultPosition,
    	  wxSize(50, 10),
    	  wxTE_MULTILINE
    	);  
    }
    andare và, però non ridimensiona nulla, la textbox è sempre grande quanto tutta la form

  4. #4
    Utente di HTML.it L'avatar di anx721
    Registrato dal
    Apr 2003
    Messaggi
    2,352
    io non ho programmato con le wxwidgets..dovresti studiarti i layout probabilmente per capire come disporre i componenti in una finestra

    Sun Certified Java Programmer

    EUCIP Core Level Certified

    European Certification of Informatics Professionals

  5. #5
    Utente di HTML.it L'avatar di Aki
    Registrato dal
    Dec 2002
    Messaggi
    2,206
    Originariamente inviato da anx721
    io non ho programmato con le wxwidgets..dovresti studiarti i layout probabilmente per capire come disporre i componenti in una finestra
    non hai link?

  6. #6
    Utente di HTML.it L'avatar di anx721
    Registrato dal
    Apr 2003
    Messaggi
    2,352
    le wxwidgets non sono molto documentate, o aleemno la documentazione c'è ma come reference, non molto come tutorial da seguire. Dalla documentazione segui il link "Class by category":

    http://www.wxwidgets.org/manuals/2.6...l#classesbycat

    e vai al paragrafo "Window layout" dove sono raccolti i link agli oggetti che gestiscono il layout, leggi anche il link "Sizer overview". Per altri argomenti, dalla pagina principale della documentazione leggi anche "Topic overviews"

    Sun Certified Java Programmer

    EUCIP Core Level Certified

    European Certification of Informatics Professionals

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.