Felhasználói eszközök

Eszközök a webhelyen


oktatas:programozas:wxwidgets:wxwidgets_kezikoenyv:esemenyek

Különbségek

A kiválasztott változat és az aktuális verzió közötti különbségek a következők.

Összehasonlító nézet linkje

oktatas:programozas:wxwidgets:wxwidgets_kezikoenyv:esemenyek [2019/08/22 11:07] – létrehozva adminoktatas:programozas:wxwidgets:wxwidgets_kezikoenyv:esemenyek [2020/08/12 00:09] (aktuális) – [Window identifiers] admin
Sor 469: Sor 469:
  
  
-==== Window identifiers ==== 
  
-Window identifiers are integers that uniquely determine the window identity in the event system. There are three ways to create window id's. +Ablak azonosítók
  
-let the system automatically create an id+Az ablakazonosítók egyedileg meghatározott  
 +egész számok, amelyek egy ablakot azonosítanak 
 +az események rendszerében. Az ablakazonosítók 
 +három módon hozhatók létre. 
  
-use standard identifiers+  * a rendszer automatikusan hozza létre 
 +  * szabványos azonosítót használunk 
 +  * saját azonosítót adunk
  
-create your own id +Minden widget rendelkezik egy azonosító paraméterrel. 
- +Ez egy egyedi azonosító az események rendszerében. 
-Each widget has an id parameterThis is a unique number in the event systemIf we work with multiple widgetswe must differantiate among them+Ha több widget-el dolgozunkkülönbözniük kell
  
 <code cpp> <code cpp>
Sor 486: Sor 490:
 </code> </code>
  
-If we provide -1 or wxID_ANY for the id parameterwe let the wxWidgets automatically create an id for usThe automatically created id's are always negativewhereas user specified id's must always be positiveWe usually use this option when we do not need to change the widget state. For example static textthat will never be changed during the life of the applicationWe can still get the idif we wantThere is method GetId(), which will determine the id for us+Ha -1-t vagy wxID_ANY-t adunk meg azonosítónak paraméterként, 
 +akkor a wxWidgets automatikusan készít egy azonosítót. 
 +Az automatikusan kreált azonosítók mindig negatív számok, 
 +így a felhasználó által megadott számoknak mindig  
 +pozitívnak kell lenniükEzt lehetőséget rendszeresen 
 +használhatjukha a widget állapota nem változik. 
 +Például egy statikus szöveg (StaticText)általában sosem változik 
 +az alkalmazás élete alattAz azonosítót ha szeretnénk 
 +megkaphatjuk. Erre a GetId() metódus áll rendelkezésre.
  
-Standard identifiers should be used whenever possibleThe identifiers can provide some standard graphics or behaviour on some platforms+Ha csak lehetséges használjunk szabványos azonosítót 
 +Az azonosítók bizonyos szabványos grafikákat és viselkedéseket 
 +biztosítanak egyes platformokon.
  
-<code cpp ident.h>+<code python ident.h>
 include <wx/wx.h> include <wx/wx.h>
 + 
 class Ident : public wxFrame class Ident : public wxFrame
 {   {  
   public:   public:
     Ident(const wxString& title);     Ident(const wxString& title);
-  + 
 }; };
 </code> </code>
  
-<code cpp ident.cpp>+<code python ident.cpp>
 #include "ident.h" #include "ident.h"
 + 
 Ident::Ident(const wxString& title) Ident::Ident(const wxString& title)
       : wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(200, 150))       : wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(200, 150))
 { {
 + 
     wxPanel *panel = new wxPanel(this, -1);     wxPanel *panel = new wxPanel(this, -1);
-  + 
     wxGridSizer *grid = new wxGridSizer(2, 3);     wxGridSizer *grid = new wxGridSizer(2, 3);
-  + 
     grid->Add(new wxButton(panel, wxID_CANCEL), 0, wxTOP | wxLEFT, 9);     grid->Add(new wxButton(panel, wxID_CANCEL), 0, wxTOP | wxLEFT, 9);
     grid->Add(new wxButton(panel, wxID_DELETE), 0, wxTOP, 9);     grid->Add(new wxButton(panel, wxID_DELETE), 0, wxTOP, 9);
Sor 518: Sor 532:
     grid->Add(new wxButton(panel, wxID_STOP), 0, wxLEFT, 9);     grid->Add(new wxButton(panel, wxID_STOP), 0, wxLEFT, 9);
     grid->Add(new wxButton(panel, wxID_NEW));     grid->Add(new wxButton(panel, wxID_NEW));
-  + 
     panel->SetSizer(grid);     panel->SetSizer(grid);
     Centre();     Centre();
Sor 524: Sor 538:
 </code> </code>
  
-<code cpp main.h>+<code python main.h>
 #include <wx/wx.h> #include <wx/wx.h>
 + 
 class MyApp : public wxApp class MyApp : public wxApp
 { {
Sor 534: Sor 548:
 </code> </code>
  
-<code cpp main.cpp>+<code python main.cpp>
 #include "main.h" #include "main.h"
 #include "ident.h" #include "ident.h"
 + 
 IMPLEMENT_APP(MyApp) IMPLEMENT_APP(MyApp)
 + 
 bool MyApp::OnInit() bool MyApp::OnInit()
 { {
 + 
       Ident *ident = new Ident(wxT("Identifiers"));       Ident *ident = new Ident(wxT("Identifiers"));
       ident->Show(true);       ident->Show(true);
-  + 
       return true;       return true;
 } }
 </code> </code>
  
-  +A példánkban szabványos azonosítókat használunk a gombok számára. 
-In our example we use standard identifiers on buttonsOn linuxthe buttons have small icons+Linuxona gombok kis ikonokkal rendelkeznek. 
  
-Identifiers  
  
-Figure: Identifiers 
  
oktatas/programozas/wxwidgets/wxwidgets_kezikoenyv/esemenyek.1566464853.txt.gz · Utolsó módosítás: 2019/08/22 11:07 szerkesztette: admin