Перейти к содержимому

Фото
- - - - -

wxWIDGETs


  • Вы не можете создать новую тему
  • Please log in to reply
22 ответов в этой теме

#1 libricon

libricon
  • Постоялец
  • 572 сообщений
  • Откуда:Маарду

Отправлено 01 сентября 2004 - 09:33

Вот решил немного освоить программироваие в линукс, посоветовали использовать wxWIDGETS, полько не могу понять как с ним работать. Список всех функций есть, описание есть, вроде ясно, но вот не могу понять как сделать само окно, т.е как это вообще делается, не могу же я написать в емак , что-то вроде на нажатие кнокки делай тото, а как сделать саму кнопку, как изменять ее положение( визуально, верю что можно сделать это координатами экрана) , если там что-то похожее на висуал с++ или надо наугад распологать кнопки, поля для записей?
  • 0
Пингвин птица гордая, пока не пнешь, не полетит!!!

#2 tomatensaft

tomatensaft

    Samurai Jack

  • Пользователь
  • 449 сообщений
  • Откуда:Tallinn

Отправлено 01 сентября 2004 - 13:54

В wxWidgets есть такая вещь как XRC. Это структурный (основанный на XML) формат файлов, описывающих графический интерфейс твоего приложения. В этих файлах хранится структура виджетов, какой где находится, какое оформление к каждому следует применить, какие опции и так далее. Вот пример такой структуры (слева): Размещенное изображение

Для редактирования XRC можно использовать XRCed. Я именно им, например, и пользуюсь. Но существуют и такие среды и редакторы, как DialogBlocks (коммерческая, можно скачать демку, Windows/Linux), wxGlade (под Linux)... Эти могут генерировать код-стаб на основе созданного тобой GUI.

XRC упрощает работу с wxWidgets. Однако, есть и традиционный метод построения GUI -- чисто программный. То есть, для создания нестандартного диалога, ты либо создаешь дочерний от wxDialog класс и реализуешь все специальные его функции. :)

Этот метод все равно придется разбирать, так как никакими XRC ты не сделаешь того, что можно сделать с элементами GUI программно. :)

Как говорится, мои $0.02. Продолжение следует.

Сообщение изменено: tomatensaft (01 сентября 2004 - 13:55 )

  • 0
"This is all I want'd t' say 'bout dat..." © Forest Gump

#3 libricon

libricon
  • Постоялец
  • 572 сообщений
  • Откуда:Маарду

Отправлено 01 сентября 2004 - 21:36

а где мне эту прогу найти=) а что, все в гноме черех этот XML делается, а то просто GDM тоже формирует свои темы через файл в формате xml?
а вот такой вопрос, я просто смотрел разные функции и заинтересовала такая вещь.
К примеру функции связанные со временем, getelapse как-то так называется, или иная другая и там постоянно в описании ссылка на класс wxTime( ну вот к примеру ::wxGetElapsedTime

long wxGetElapsedTime(bool resetTimer = TRUE)

Gets the time in milliseconds since the last ::wxStartTimer.

If resetTimer is TRUE (the default), the timer is reset to zero by this call.

See also wxTimer.

Include files

<wx/timer.h> такое описание) и что это значит особенно ::wxStartTimer (похоже на функцию класса) , т.е эти функции без включения класса использовать нельзя или как?
а если посмотреть описание класса, то там своих функций навалом, причем других и другого назначения!
обьясните пожалуста, кто польуется лучше знает ведб =)
ах да, и еще некоторые функции получают значения, параметры в смысле, почему они все со звездочкой, это вроде указатель - да? чисто для улучшения эффективности и защиты от изменения данных, а то я в программировании не очень , обьясните пожалуста, и можно ли передавать копию значения просто вставлясс например переменную а ?
  • 0
Пингвин птица гордая, пока не пнешь, не полетит!!!

#4 libricon

libricon
  • Постоялец
  • 572 сообщений
  • Откуда:Маарду

Отправлено 01 сентября 2004 - 21:39

а этот XRC не для си и не для wxc++
разбор полетов, по статье я сделал программу наподобии hello world!
на команду gcc first.cpp получил :
first.cpp:1: error: parse error before ./' token
In file included from /usr/local/include/wx/defs.h:23,
from /usr/local/include/wx/wxprec.h:13,
from first.cpp:8:
/usr/local/include/wx/platform.h:85:22: wx/setup.h: No such file or directory
In file included from /usr/local/include/wx/platform.h:88,
from /usr/local/include/wx/defs.h:23,
from /usr/local/include/wx/wxprec.h:13,
from first.cpp:8:
/usr/local/include/wx/chkconf.h:47:9: #error "wxUSE_DYNLIB_CLASS must be defined."
/usr/local/include/wx/chkconf.h:55:9: #error "wxUSE_FILESYSTEM must be defined."
/usr/local/include/wx/chkconf.h:68:9: #error "wxUSE_DYNAMIC_LOADER must be defined."
/usr/local/include/wx/chkconf.h:76:9: #error "wxUSE_LOG must be defined."
/usr/local/include/wx/chkconf.h:84:9: #error "wxUSE_LONGLONG must be defined."
/usr/local/include/wx/chkconf.h:92:9: #error "wxUSE_MIMETYPE must be defined."
/usr/local/include/wx/chkconf.h:100:9: #error "wxUSE_PROLOGIO must be defined."
/usr/local/include/wx/chkconf.h:108:9: #error "wxUSE_PROTOCOL must be defined."
/usr/local/include/wx/chkconf.h:150:9: #error "wxUSE_REGEX must be defined."
/usr/local/include/wx/chkconf.h:158:9: #error "wxUSE_SOCKETS must be defined."
/usr/local/include/wx/chkconf.h:166:9: #error "wxUSE_STREAMS must be defined."
/usr/local/include/wx/chkconf.h:174:9: #error "wxUSE_STOPWATCH must be defined."
/usr/local/include/wx/chkconf.h:182:9: #error "wxUSE_TEXTBUFFER must be defined."
/usr/local/include/wx/chkconf.h:190:9: #error "wxUSE_TEXTFILE must be defined."
/usr/local/include/wx/chkconf.h:198:9: #error "wxUSE_UNICODE must be defined."
/usr/local/include/wx/chkconf.h:206:9: #error "wxUSE_URL must be defined."
/usr/local/include/wx/chkconf.h:224:9: #error "wxUSE_ACCEL must be defined."
/usr/local/include/wx/chkconf.h:232:9: #error "wxUSE_BMPBUTTON must be defined."
/usr/local/include/wx/chkconf.h:240:9: #error "wxUSE_BUTTON must be defined."
/usr/local/include/wx/chkconf.h:248:9: #error "wxUSE_CALENDARCTRL must be defined."
/usr/local/include/wx/chkconf.h:256:9: #error "wxUSE_CARET must be defined."
/usr/local/include/wx/chkconf.h:264:9: #error "wxUSE_CHECKBOX must be defined."
/usr/local/include/wx/chkconf.h:272:9: #error "wxUSE_CHECKLISTBOX must be defined."
/usr/local/include/wx/chkconf.h:280:9: #error "wxUSE_CHOICE must be defined."
/usr/local/include/wx/chkconf.h:288:9: #error "wxUSE_CHOICEDLG must be defined."
/usr/local/include/wx/chkconf.h:296:9: #error "wxUSE_CLIPBOARD must be defined."
/usr/local/include/wx/chkconf.h:304:9: #error "wxUSE_COLOURDLG must be defined."
/usr/local/include/wx/chkconf.h:312:9: #error "wxUSE_COMBOBOX must be defined."
/usr/local/include/wx/chkconf.h:320:9: #error "wxUSE_DATAOBJ must be defined."
/usr/local/include/wx/chkconf.h:328:9: #error "wxUSE_DOC_VIEW_ARCHITECTURE must be defined."
/usr/local/include/wx/chkconf.h:336:9: #error "wxUSE_FILEDLG must be defined."
/usr/local/include/wx/chkconf.h:344:9: #error "wxUSE_FONTDLG must be defined."
/usr/local/include/wx/chkconf.h:352:9: #error "wxUSE_FONTMAP must be defined."
/usr/local/include/wx/chkconf.h:360:9: #error "wxUSE_GAUGE must be defined."
/usr/local/include/wx/chkconf.h:368:9: #error "wxUSE_GRID must be defined."
/usr/local/include/wx/chkconf.h:376:9: #error "wxUSE_HELP must be defined."
/usr/local/include/wx/chkconf.h:384:9: #error "wxUSE_HTML must be defined."
/usr/local/include/wx/chkconf.h:392:9: #error "wxUSE_ICO_CUR must be defined."
/usr/local/include/wx/chkconf.h:400:9: #error "wxUSE_IFF must be defined."
/usr/local/include/wx/chkconf.h:408:9: #error "wxUSE_IMAGLIST must be defined."
/usr/local/include/wx/chkconf.h:416:9: #error "wxUSE_JOYSTICK must be defined."
/usr/local/include/wx/chkconf.h:424:9: #error "wxUSE_LISTBOX must be defined."
/usr/local/include/wx/chkconf.h:432:9: #error "wxUSE_LISTCTRL must be defined."
/usr/local/include/wx/chkconf.h:440:9: #error "wxUSE_LOGGUI must be defined."
/usr/local/include/wx/chkconf.h:448:9: #error "wxUSE_LOGWINDOW must be defined."
/usr/local/include/wx/chkconf.h:456:9: #error "wxUSE_LOG_DIALOG must be defined."
/usr/local/include/wx/chkconf.h:464:9: #error "wxUSE_MDI_ARCHITECTURE must be defined."
/usr/local/include/wx/chkconf.h:472:9: #error "wxUSE_MENUS must be defined."
/usr/local/include/wx/chkconf.h:480:9: #error "wxUSE_MSGDLG must be defined."
/usr/local/include/wx/chkconf.h:488:9: #error "wxUSE_NEW_GRID must be defined."
/usr/local/include/wx/chkconf.h:496:9: #error "wxUSE_NOTEBOOK must be defined."
/usr/local/include/wx/chkconf.h:504:9: #error "wxUSE_PALETTE must be defined."
/usr/local/include/wx/chkconf.h:512:9: #error "wxUSE_POPUPWIN must be defined."
/usr/local/include/wx/chkconf.h:520:9: #error "wxUSE_PRINTING_ARCHITECTURE must be defined."
/usr/local/include/wx/chkconf.h:528:9: #error "wxUSE_RADIOBOX must be defined."
/usr/local/include/wx/chkconf.h:536:9: #error "wxUSE_RADIOBTN must be defined."
/usr/local/include/wx/chkconf.h:544:9: #error "wxUSE_SASH must be defined."
/usr/local/include/wx/chkconf.h:552:9: #error "wxUSE_SCROLLBAR must be defined."
/usr/local/include/wx/chkconf.h:560:9: #error "wxUSE_SLIDER must be defined."
/usr/local/include/wx/chkconf.h:568:9: #error "wxUSE_SPINBTN must be defined."
/usr/local/include/wx/chkconf.h:576:9: #error "wxUSE_SPINCTRL must be defined."
/usr/local/include/wx/chkconf.h:584:9: #error "wxUSE_SPLASH must be defined."
/usr/local/include/wx/chkconf.h:592:9: #error "wxUSE_SPLITTER must be defined."
/usr/local/include/wx/chkconf.h:600:9: #error "wxUSE_STATBMP must be defined."
/usr/local/include/wx/chkconf.h:608:9: #error "wxUSE_STATBOX must be defined."
/usr/local/include/wx/chkconf.h:616:9: #error "wxUSE_STATLINE must be defined."
/usr/local/include/wx/chkconf.h:624:9: #error "wxUSE_STATTEXT must be defined."
/usr/local/include/wx/chkconf.h:632:9: #error "wxUSE_STATUSBAR must be defined."
/usr/local/include/wx/chkconf.h:640:9: #error "wxUSE_TAB_DIALOG must be defined."
/usr/local/include/wx/chkconf.h:648:9: #error "wxUSE_TEXTCTRL must be defined."
/usr/local/include/wx/chkconf.h:656:9: #error "wxUSE_TIPWINDOW must be defined."
/usr/local/include/wx/chkconf.h:664:9: #error "wxUSE_TOOLBAR must be defined."
/usr/local/include/wx/chkconf.h:672:9: #error "wxUSE_TOOLTIPS must be defined."
/usr/local/include/wx/chkconf.h:680:9: #error "wxUSE_TREECTRL must be defined."
/usr/local/include/wx/chkconf.h:688:9: #error "wxUSE_WX_RESOURCES must be defined."
/usr/local/include/wx/chkconf.h:696:9: #error "wxUSE_WXHTML_HELP must be defined."
/usr/local/include/wx/chkconf.h:1138:9: #error "wxMessageBox is always needed"
/usr/local/include/wx/chkconf.h:1184:9: #error "wxUSE_DYNAMIC_CLASSES must be defined as 1"
In file included from /usr/local/include/wx/wxprec.h:13,
from first.cpp:8:
/usr/local/include/wx/defs.h:32:2: #error "No Target! You should use wx-config program for compilation flags!"
In file included from /usr/local/include/wx/memory.h:20,
from /usr/local/include/wx/object.h:25,
from /usr/local/include/wx/wx.h:16,
from first.cpp:15:
/usr/local/include/wx/string.h:443: error: .wxChar
wxString::operator[](unsigned int) const' and .wxChar
wxString::operator[](unsigned int) const' cannot be overloaded
/usr/local/include/wx/string.h:447: error: .wxChar&
wxString::operator[](unsigned int)' and .wxChar&
wxString::operator[](unsigned int)' cannot be overloaded
In file included from /usr/local/include/wx/wx.h:16,
from first.cpp:15:
/usr/local/include/wx/object.h:438: error: .wxClassInfo' was not declared in
this scope
/usr/local/include/wx/object.h:438: error: .info' was not declared in this
scope
/usr/local/include/wx/object.h:438: error: invalid data member initialization
/usr/local/include/wx/object.h:438: error: (use .=' to initialize static data
members)
/usr/local/include/wx/object.h:479: error: syntax error before .*' token
/usr/local/include/wx/object.h:480: error: semicolon missing after declaration
of .wxObject'
/usr/local/include/wx/object.h: In constructor .wxObject::wxObject()':
/usr/local/include/wx/object.h:420: error: .m_refData' undeclared (first use
this function)
/usr/local/include/wx/object.h:420: error: (Each undeclared identifier is
reported only once for each function it appears in.)
/usr/local/include/wx/object.h: In destructor .virtual wxObject::~wxObject()':
/usr/local/include/wx/object.h:421: error: .UnRef' undeclared (first use this
function)
/usr/local/include/wx/object.h: At global scope:
/usr/local/include/wx/object.h:480: error: .wxObjectRefData' was not declared
in this scope
/usr/local/include/wx/object.h:480: error: .data' was not declared in this
scope
/usr/local/include/wx/object.h:480: error: ISO C++ forbids defining types
within return type
/usr/local/include/wx/object.h:480: error: two or more data types in
declaration of .SetRefData'
/usr/local/include/wx/object.h:480: error: syntax error before .{' token
/usr/local/include/wx/object.h:486: error: .void UnRef()' used prior to
declaration
/usr/local/include/wx/object.h:488: error: parse error before .protected'
/usr/local/include/wx/object.h:498: error: syntax error before .*' token
/usr/local/include/wx/object.h:501: error: syntax error before .*' token
/usr/local/include/wx/object.h:503: error: syntax error before .*' token
/usr/local/include/wx/object.h:525: error: type specifier omitted for parameter
.wxClassInfo'
/usr/local/include/wx/object.h:525: error: parse error before .*' token
/usr/local/include/wx/object.h: In function .wxObject* wxCheckDynamicCast(...)
':
/usr/local/include/wx/object.h:527: error: .obj' undeclared (first use this
function)
/usr/local/include/wx/object.h:527: error: .classInfo' undeclared (first use
this function)
In file included from /usr/local/include/wx/wx.h:22,
from first.cpp:15:
/usr/local/include/wx/log.h:19:22: wx/setup.h: No such file or directory
In file included from /usr/local/include/wx/event.h:24,
from /usr/local/include/wx/wx.h:23,
from first.cpp:15:
/usr/local/include/wx/gdicmn.h:27:22: wx/setup.h: No such file or directory
In file included from /usr/local/include/wx/font.h:24,
from /usr/local/include/wx/gdicmn.h:29,
from /usr/local/include/wx/event.h:24,
from /usr/local/include/wx/wx.h:23,
from first.cpp:15:
/usr/local/include/wx/fontenc.h:131:6: #error "Unsupported toolkit"
In file included from /usr/local/include/wx/gdicmn.h:29,
from /usr/local/include/wx/event.h:24,
from /usr/local/include/wx/wx.h:23,
from first.cpp:15:
/usr/local/include/wx/font.h: At global scope:
/usr/local/include/wx/font.h:82: error: parse error before .{' token
/usr/local/include/wx/font.h:104: error: non-member function .bool Ok()' cannot
have .const' method qualifier
/usr/local/include/wx/font.h:107: error: non-member function .bool
operator==(const wxFont&)' cannot have .const' method qualifier
/usr/local/include/wx/font.h:107: error: .bool operator==(const wxFont&)' must
take exactly two arguments
/usr/local/include/wx/font.h:108: error: non-member function .bool
operator!=(const wxFont&)' cannot have .const' method qualifier
/usr/local/include/wx/font.h:108: error: .bool operator!=(const wxFont&)' must
take exactly two arguments
/usr/local/include/wx/font.h:111: error: virtual outside class declaration
/usr/local/include/wx/font.h:111: error: non-member function .int
GetPointSize()' cannot have .const' method qualifier
/usr/local/include/wx/font.h:111: error: function .int GetPointSize()' is
initialized like a variable
/usr/local/include/wx/font.h:112: error: virtual outside class declaration
/usr/local/include/wx/font.h:112: error: non-member function .int GetFamily()'
cannot have .const' method qualifier
/usr/local/include/wx/font.h:112: error: function .int GetFamily()' is
initialized like a variable
/usr/local/include/wx/font.h:113: error: virtual outside class declaration
/usr/local/include/wx/font.h:113: error: non-member function .int GetStyle()'
cannot have .const' method qualifier
/usr/local/include/wx/font.h:113: error: function .int GetStyle()' is
initialized like a variable
/usr/local/include/wx/font.h:114: error: virtual outside class declaration
/usr/local/include/wx/font.h:114: error: non-member function .int GetWeight()'
cannot have .const' method qualifier
/usr/local/include/wx/font.h:114: error: function .int GetWeight()' is
initialized like a variable
/usr/local/include/wx/font.h:115: error: virtual outside class declaration
/usr/local/include/wx/font.h:115: error: non-member function .bool
GetUnderlined()' cannot have .const' method qualifier
/usr/local/include/wx/font.h:115: error: function .bool GetUnderlined()' is
initialized like a variable
/usr/local/include/wx/font.h:116: error: virtual outside class declaration
/usr/local/include/wx/font.h:116: error: non-member function .wxString
GetFaceName()' cannot have .const' method qualifier
/usr/local/include/wx/font.h:116: error: function .wxString GetFaceName()' is
initialized like a variable
/usr/local/include/wx/font.h:117: error: virtual outside class declaration
/usr/local/include/wx/font.h:117: error: non-member function .wxFontEncoding
GetEncoding()' cannot have .const' method qualifier
/usr/local/include/wx/font.h:117: error: function .wxFontEncoding GetEncoding()
' is initialized like a variable
/usr/local/include/wx/font.h:118: error: virtual outside class declaration
/usr/local/include/wx/font.h:118: error: non-member function .wxNativeFontInfo*
GetNativeFontInfo()' cannot have .const' method qualifier
/usr/local/include/wx/font.h:120: error: virtual outside class declaration
/usr/local/include/wx/font.h:120: error: non-member function .bool
IsFixedWidth()' cannot have .const' method qualifier
/usr/local/include/wx/font.h:122: error: non-member function .wxString
GetNativeFontInfoDesc()' cannot have .const' method qualifier
/usr/local/include/wx/font.h:123: error: non-member function .wxString
GetNativeFontInfoUserDesc()' cannot have .const' method qualifier
/usr/local/include/wx/font.h:126: error: virtual outside class declaration
/usr/local/include/wx/font.h:126: error: function .void SetPointSize(int)' is
initialized like a variable
/usr/local/include/wx/font.h:127: error: virtual outside class declaration
/usr/local/include/wx/font.h:127: error: function .void SetFamily(int)' is
initialized like a variable
/usr/local/include/wx/font.h:128: error: virtual outside class declaration
/usr/local/include/wx/font.h:128: error: function .void SetStyle(int)' is
initialized like a variable
/usr/local/include/wx/font.h:129: error: virtual outside class declaration
/usr/local/include/wx/font.h:129: error: function .void SetWeight(int)' is
initialized like a variable
/usr/local/include/wx/font.h:130: error: virtual outside class declaration
/usr/local/include/wx/font.h:130: error: function .void SetFaceName(const
wxString&)' is initialized like a variable
/usr/local/include/wx/font.h:131: error: virtual outside class declaration
/usr/local/include/wx/font.h:131: error: function .void SetUnderlined(bool)' is
initialized like a variable
/usr/local/include/wx/font.h:132: error: virtual outside class declaration
/usr/local/include/wx/font.h:132: error: function .void
SetEncoding(wxFontEncoding)' is initialized like a variable
/usr/local/include/wx/font.h:133: error: virtual outside class declaration
/usr/local/include/wx/font.h:140: error: non-member function .wxString
GetFamilyString()' cannot have .const' method qualifier
/usr/local/include/wx/font.h:141: error: non-member function .wxString
GetStyleString()' cannot have .const' method qualifier
/usr/local/include/wx/font.h:142: error: non-member function .wxString
GetWeightString()' cannot have .const' method qualifier
/usr/local/include/wx/font.h:145: error: virtual outside class declaration
/usr/local/include/wx/font.h:146: error: virtual outside class declaration
/usr/local/include/wx/font.h: In function .wxFontEncoding GetDefaultEncoding()
':
/usr/local/include/wx/font.h:150: error: .ms_encodingDefault' undeclared (first
use this function)
/usr/local/include/wx/font.h: At global scope:
/usr/local/include/wx/font.h:153: error: parse error before .protected'
In file included from /usr/local/include/wx/event.h:25,
from /usr/local/include/wx/wx.h:23,
from first.cpp:15:
/usr/local/include/wx/cursor.h: In destructor .
wxBusyCursorSuspender::~wxBusyCursorSuspender()':
/usr/local/include/wx/cursor.h:55: error: invalid use of undefined type .const
struct wxCursor'
/usr/local/include/wx/gdicmn.h:38: error: forward declaration of .const struct
wxCursor'
In file included from /usr/local/include/wx/wx.h:23,
from first.cpp:15:
/usr/local/include/wx/event.h: At global scope:
/usr/local/include/wx/event.h:801: error: field .m_cursor' has incomplete type
/usr/local/include/wx/event.h: In constructor .
wxSetCursorEvent::wxSetCursorEvent(int, int)':
/usr/local/include/wx/event.h:782: error: class .wxSetCursorEvent' does not
have any field named .m_cursor'
/usr/local/include/wx/event.h: In copy constructor .
wxSetCursorEvent::wxSetCursorEvent(const wxSetCursorEvent&)':
/usr/local/include/wx/event.h:788: error: .m_cursor' undeclared (first use this
function)
/usr/local/include/wx/event.h:788: error: 'const class wxSetCursorEvent' has no
member named 'm_cursor'
In file included from /usr/local/include/wx/app.h:27,
from /usr/local/include/wx/wx.h:24,
from first.cpp:15:
/usr/local/include/wx/window.h: At global scope:
/usr/local/include/wx/window.h:847: error: .WXWidget' declared as a .virtual'
field
/usr/local/include/wx/window.h:847: error: parse error before .(' token
/usr/local/include/wx/window.h:901: error: field .m_cursor' has incomplete type
/usr/local/include/wx/window.h:902: error: field .m_font' has incomplete type
/usr/local/include/wx/window.h:903: error: field .m_backgroundColour' has
incomplete type
/usr/local/include/wx/window.h:903: error: field .m_foregroundColour' has
incomplete type
/usr/local/include/wx/window.h:910: error: field .m_updateRegion' has
incomplete type
/usr/local/include/wx/window.h: In member function .const wxRegion&
wxWindowBase::GetUpdateRegion() const':
/usr/local/include/wx/window.h:591: error: .m_updateRegion' undeclared (first
use this function)
/usr/local/include/wx/window.h: In member function .wxColour
wxWindowBase::GetBackgroundColour() const':
/usr/local/include/wx/window.h:615: error: return type .struct wxColour' is
incomplete
/usr/local/include/wx/window.h:615: error: .m_backgroundColour' undeclared
(first use this function)
/usr/local/include/wx/window.h: In member function .wxColour
wxWindowBase::GetForegroundColour() const':
/usr/local/include/wx/window.h:616: error: return type .struct wxColour' is
incomplete
/usr/local/include/wx/window.h:616: error: .m_foregroundColour' undeclared
(first use this function)
/usr/local/include/wx/window.h: In member function .const wxFont&
wxWindowBase::GetFont() const':
/usr/local/include/wx/window.h:627: error: .m_font' undeclared (first use this
function)
/usr/local/include/wx/window.h: In member function .wxWindow*
wxWindowBase::GetGrandParent() const':
/usr/local/include/wx/window.h:1156: error: .GetParent' undeclared (first use
this function)
In file included from /usr/local/include/wx/wx.h:24,
from first.cpp:15:
/usr/local/include/wx/app.h: At global scope:
/usr/local/include/wx/app.h:456: error: syntax error before .*' token
/usr/local/include/wx/app.h: In constructor .
wxAppInitializer::wxAppInitializer(wxObject*(*)())':
/usr/local/include/wx/app.h:536: error: .wxApp' undeclared (first use this
function)
/usr/local/include/wx/app.h:536: error: parse error before .;' token
In file included from /usr/local/include/wx/panel.h:4,
from /usr/local/include/wx/wx.h:31,
from first.cpp:15:
/usr/local/include/wx/generic/panelg.h: At global scope:
/usr/local/include/wx/generic/panelg.h:35: error: base class .wxWindow' has
incomplete type
In file included from /usr/local/include/wx/frame.h:23,
from /usr/local/include/wx/wx.h:32,
from first.cpp:15:
/usr/local/include/wx/toplevel.h:61: error: base class .wxWindow' has
incomplete type
In file included from /usr/local/include/wx/dc.h:30,
from /usr/local/include/wx/wx.h:33,
from first.cpp:15:
/usr/local/include/wx/palette.h:5:22: wx/setup.h: No such file or directory
In file included from /usr/local/include/wx/wx.h:33,
from first.cpp:15:
/usr/local/include/wx/dc.h:738: error: field .m_pen' has incomplete type
/usr/local/include/wx/dc.h:739: error: field .m_brush' has incomplete type
/usr/local/include/wx/dc.h:740: error: field .m_backgroundBrush' has incomplete
type
/usr/local/include/wx/dc.h:741: error: field .m_textForegroundColour' has
incomplete type
/usr/local/include/wx/dc.h:742: error: field .m_textBackgroundColour' has
incomplete type
/usr/local/include/wx/dc.h:743: error: field .m_font' has incomplete type
/usr/local/include/wx/dc.h: In constructor .wxDCBase::wxDCBase()':
/usr/local/include/wx/dc.h:122: error: class .wxDCBase' does not have any field
named .m_pen'
/usr/local/include/wx/dc.h:123: error: class .wxDCBase' does not have any field
named .m_brush'
/usr/local/include/wx/dc.h:124: error: class .wxDCBase' does not have any field
named .m_backgroundBrush'
/usr/local/include/wx/dc.h:125: error: class .wxDCBase' does not have any field
named .m_textForegroundColour'
/usr/local/include/wx/dc.h:126: error: class .wxDCBase' does not have any field
named .m_textBackgroundColour'
/usr/local/include/wx/dc.h:127: error: class .wxDCBase' does not have any field
named .m_font'
/usr/local/include/wx/dc.h: In member function .const wxBrush&
wxDCBase::GetBackground() const':
/usr/local/include/wx/dc.h:429: error: .m_backgroundBrush' undeclared (first
use this function)
/usr/local/include/wx/dc.h: In member function .const wxBrush&
wxDCBase::GetBrush() const':
/usr/local/include/wx/dc.h:430: error: .m_brush' undeclared (first use this
function)
/usr/local/include/wx/dc.h: In member function .const wxPen& wxDCBase::GetPen()
const':
/usr/local/include/wx/dc.h:432: error: .m_pen' undeclared (first use this
function)
/usr/local/include/wx/dc.h: In member function .const wxColour&
wxDCBase::GetTextBackground() const':
/usr/local/include/wx/dc.h:433: error: .m_textBackgroundColour' undeclared
(first use this function)
/usr/local/include/wx/dc.h: In member function .const wxColour&
wxDCBase::GetTextForeground() const':
/usr/local/include/wx/dc.h:434: error: .m_textForegroundColour' undeclared
(first use this function)
/usr/local/include/wx/dc.h: At global scope:
/usr/local/include/wx/dc.h:803: error: field .m_colFgOld' has incomplete type
/usr/local/include/wx/dc.h: In constructor .
wxDCTextColourChanger::wxDCTextColourChanger(wxDC&)':
/usr/local/include/wx/dc.h:785: error: class .wxDCTextColourChanger' does not
have any field named .m_colFgOld'
/usr/local/include/wx/dc.h: In destructor .
wxDCTextColourChanger::~wxDCTextColourChanger()':
/usr/local/include/wx/dc.h:789: error: .m_colFgOld' undeclared (first use this
function)
/usr/local/include/wx/dc.h:790: error: .SetTextForeground' undeclared (first
use this function)
/usr/local/include/wx/dc.h: In member function .void
wxDCTextColourChanger::Set(const wxColour&)':
/usr/local/include/wx/dc.h:796: error: .GetTextForeground' undeclared (first
use this function)
/usr/local/include/wx/dc.h:797: error: .SetTextForeground' undeclared (first
use this function)
/usr/local/include/wx/dc.h: In constructor .wxDCClipper::wxDCClipper(wxDC&,
const wxRect&)':
/usr/local/include/wx/dc.h:815: error: .SetClippingRegion' undeclared (first
use this function)
/usr/local/include/wx/dc.h: In constructor .wxDCClipper::wxDCClipper(wxDC&,
int, int, int, int)':
/usr/local/include/wx/dc.h:817: error: .SetClippingRegion' undeclared (first
use this function)
/usr/local/include/wx/dc.h: In destructor .wxDCClipper::~wxDCClipper()':
/usr/local/include/wx/dc.h:819: error: .DestroyClippingRegion' undeclared
(first use this function)
In file included from /usr/local/include/wx/wx.h:46,
from first.cpp:15:
/usr/local/include/wx/timer.h:20:22: wx/setup.h: No such file or directory
In file included from /usr/local/include/wx/wx.h:47,
from first.cpp:15:
/usr/local/include/wx/settings.h: In static member function .static wxColour
wxSystemSettings::GetSystemColour(int)':
/usr/local/include/wx/settings.h:199: error: return type .struct wxColour' is
incomplete
/usr/local/include/wx/settings.h:199: error: invalid use of undefined type .
struct wxColour'
/usr/local/include/wx/gdicmn.h:37: error: forward declaration of .struct
wxColour'
/usr/local/include/wx/settings.h: In static member function .static wxFont
wxSystemSettings::GetSystemFont(int)':
/usr/local/include/wx/settings.h:201: error: return type .struct wxFont' is
incomplete
/usr/local/include/wx/settings.h:201: error: invalid use of undefined type .
struct wxFont'
/usr/local/include/wx/font.h:33: error: forward declaration of .struct wxFont'
In file included from /usr/local/include/wx/wx.h:49,
from first.cpp:15:
/usr/local/include/wx/cmndata.h: At global scope:
/usr/local/include/wx/cmndata.h:44: error: field .dataColour' has incomplete
type
/usr/local/include/wx/cmndata.h:45: error: field .custColours' has incomplete
type
/usr/local/include/wx/cmndata.h: In member function .void
wxColourData::SetColour(const wxColour&)':
/usr/local/include/wx/cmndata.h:33: error: .dataColour' undeclared (first use
this function)
/usr/local/include/wx/cmndata.h: At global scope:
/usr/local/include/wx/cmndata.h:118: error: field .fontColour' has incomplete
type
/usr/local/include/wx/cmndata.h:122: error: field .initialFont' has incomplete
type
/usr/local/include/wx/cmndata.h:123: error: field .chosenFont' has incomplete
type
/usr/local/include/wx/cmndata.h: In copy constructor .
wxFontData::wxFontData(const wxFontData&)':
/usr/local/include/wx/cmndata.h:60: error: class .wxFontData' does not have any
field named .fontColour'
/usr/local/include/wx/cmndata.h:60: error: 'const class wxFontData' has no
member named 'fontColour'
/usr/local/include/wx/cmndata.h:64: error: class .wxFontData' does not have any
field named .initialFont'
/usr/local/include/wx/cmndata.h:64: error: 'const class wxFontData' has no
member named 'initialFont'
/usr/local/include/wx/cmndata.h:65: error: class .wxFontData' does not have any
field named .chosenFont'
/usr/local/include/wx/cmndata.h:65: error: 'const class wxFontData' has no
member named 'chosenFont'
/usr/local/include/wx/cmndata.h: In member function .wxFontData&
wxFontData::operator=(const wxFontData&)':
/usr/local/include/wx/cmndata.h:76: error: .fontColour' undeclared (first use
this function)
/usr/local/include/wx/cmndata.h:76: error: 'const class wxFontData' has no
member named 'fontColour'
/usr/local/include/wx/cmndata.h:80: error: .initialFont' undeclared (first use
this function)
/usr/local/include/wx/cmndata.h:80: error: 'const class wxFontData' has no
member named 'initialFont'
/usr/local/include/wx/cmndata.h:81: error: .chosenFont' undeclared (first use
this function)
/usr/local/include/wx/cmndata.h:81: error: 'const class wxFontData' has no
member named 'chosenFont'
/usr/local/include/wx/cmndata.h: In member function .wxFont
wxFontData::GetInitialFont() const':
/usr/local/include/wx/cmndata.h:102: error: return type .struct wxFont' is
incomplete
/usr/local/include/wx/cmndata.h: In member function .wxFont
wxFontData::GetChosenFont() const':
/usr/local/include/wx/cmndata.h:105: error: return type .struct wxFont' is
incomplete
In file included from /usr/local/include/wx/wx.h:67,
from first.cpp:15:
/usr/local/include/wx/scrolwin.h: In member function .wxSize
wxScrollHelper::GetTargetSize() const':
/usr/local/include/wx/scrolwin.h:158: error: .GetClientSize' undeclared (first
use this function)
In file included from /usr/local/include/wx/scrolwin.h:213,
from /usr/local/include/wx/wx.h:67,
from first.cpp:15:
/usr/local/include/wx/generic/scrolwin.h: In constructor .
wxGenericScrolledWindow::wxGenericScrolledWindow()':
/usr/local/include/wx/generic/scrolwin.h:46: error: no matching function for
call to .wxScrollHelper::wxScrollHelper(wxGenericScrolledWindow* const)'
/usr/local/include/wx/scrolwin.h:27: error: candidates are:
wxScrollHelper::wxScrollHelper(const wxScrollHelper&)
/usr/local/include/wx/scrolwin.h:30: error:
wxScrollHelper::wxScrollHelper(wxWindow*)
/usr/local/include/wx/generic/scrolwin.h: In constructor .
wxGenericScrolledWindow::wxGenericScrolledWindow(wxWindow*, int, const
wxPoint&, const wxSize&, long int, const wxString&)':
/usr/local/include/wx/generic/scrolwin.h:54: error: no matching function for
call to .wxScrollHelper::wxScrollHelper(wxGenericScrolledWindow* const)'
/usr/local/include/wx/scrolwin.h:27: error: candidates are:
wxScrollHelper::wxScrollHelper(const wxScrollHelper&)
/usr/local/include/wx/scrolwin.h:30: error:
wxScrollHelper::wxScrollHelper(wxWindow*)
In file included from /usr/local/include/wx/choicdlg.h:4,
from /usr/local/include/wx/wx.h:77,
from first.cpp:15:
/usr/local/include/wx/generic/choicdgg.h: At global scope:
/usr/local/include/wx/generic/choicdgg.h:39: error: parse error before .{'
token
/usr/local/include/wx/generic/choicdgg.h:43: error: parse error before .*'
token
/usr/local/include/wx/generic/choicdgg.h:63: error: parse error before .
protected'
/usr/local/include/wx/generic/choicdgg.h:72: error: base class .
wxAnyChoiceDialog' has incomplete type
/usr/local/include/wx/generic/choicdgg.h: In member function .char*
wxSingleChoiceDialog::GetSelectionClientData() const':
/usr/local/include/wx/generic/choicdgg.h:102: error: .m_clientData' undeclared
(first use this function)
/usr/local/include/wx/generic/choicdgg.h: At global scope:
/usr/local/include/wx/generic/choicdgg.h:141: error: base class .
wxAnyChoiceDialog' has incomplete type
In file included from /usr/local/include/wx/textdlg.h:4,
from /usr/local/include/wx/wx.h:78,
from first.cpp:15:
/usr/local/include/wx/generic/textdlgg.h:39: error: parse error before .{'
token
/usr/local/include/wx/generic/textdlgg.h:49: error: non-member function .
wxString GetValue()' cannot have .const' method qualifier
/usr/local/include/wx/generic/textdlgg.h: In function .wxString GetValue()':
/usr/local/include/wx/generic/textdlgg.h:49: error: .m_value' undeclared (first
use this function)
/usr/local/include/wx/generic/textdlgg.h: At global scope:
/usr/local/include/wx/generic/textdlgg.h:61: error: parse error before .
protected'
/usr/local/include/wx/generic/textdlgg.h:63: error: .wxString m_value' used
prior to declaration
/usr/local/include/wx/generic/textdlgg.h:66: error: parse error before .private
'
/usr/local/include/wx/generic/textdlgg.h:67: error: virtual outside class
declaration
/usr/local/include/wx/generic/textdlgg.h:67: error: non-member function .const
wxEventTable* GetEventTable()' cannot have .const' method qualifier
/usr/local/include/wx/generic/textdlgg.h:69: error: parse error before .}'
token
first.cpp:21: error: parse error before .{' token
first.cpp:28: error: base class .wxFrame' has incomplete type
first.cpp:49: error: incomplete type .wxFrame' does not have member .
sm_eventTable'
first.cpp:56: error: syntax error before .*' token
first.cpp:56: error: .wxCreateApp' was not declared in this scope
first.cpp: In function .MyApp& wxGetApp()':
first.cpp:56: error: .wxTheApp' undeclared (first use this function)
first.cpp: At global scope:
first.cpp:61: error: invalid use of undefined type .class MyApp'
first.cpp:20: error: forward declaration of .class MyApp'
first.cpp: In member function .bool MyApp::OnInit()':
first.cpp:63: error: .Show' undeclared (first use this function)
first.cpp:64: error: .SetTopWindow' undeclared (first use this function)
first.cpp: In constructor .MyFrame::MyFrame(const wxString&, const wxPoint&,
const wxSize&)':
first.cpp:71: error: type .struct wxFrame' is not a direct base of .MyFrame'
first.cpp:73: error: invalid use of undefined type .struct wxMenu'
/usr/local/include/wx/event.h:38: error: forward declaration of .struct wxMenu'
first.cpp:75: error: .Append' undeclared (first use this function)
first.cpp:76: error: .AppendSeparator' undeclared (first use this function)
first.cpp:79: error: invalid use of undefined type .struct wxMenuBar'
/usr/local/include/wx/frame.h:31: error: forward declaration of .struct
wxMenuBar'
first.cpp:82: error: .SetMenuBar' undeclared (first use this function)
first.cpp:84: error: .CreateStatusBar' undeclared (first use this function)
first.cpp:85: error: .SetStatusText' undeclared (first use this function)
first.cpp: In member function .void MyFrame::OnQuit(wxCommandEvent&)':
first.cpp:92: error: .Close' undeclared (first use this function)
first.cpp: In member function .void MyFrame::OnAbout(wxCommandEvent&)':
first.cpp:100: error: .wxMessageBox' undeclared (first use this function)

файл не могу прикрепить, пра нет, так что держите здесь же :

/
// file name: hworld.cpp
//
// purpose: wxWindows "Hello world"
//

// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#include "wx/wx.h
#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
//Practically every app should define a new class derived from wxApp. By overriding wxApp's OnInit() the program can be //initialized, e.g. by creating a new main window.

class MyApp: public wxApp
{
virtual bool OnInit();
};

//The main window is created by deriving a class from wxFrame and giving it a menu and a status bar in its constructor. //Also, any class that wishes to respond to any "event" (such as mouse clicks or messages from the menu or a button) must //declare an event table using the macro below. Finally, the way to react to such events must be done in "handlers". In //our sample, we react to two menu items, one for "Quit" and one for displaying an "About" window. These handlers should //not be virtual.

class MyFrame: public wxFrame
{
public:
MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size);

void OnQuit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);

private:
DECLARE_EVENT_TABLE()
};

/*In order to be able to react to a menu command, it must be given a unique identifier such as a const or an enum.*/

enum
{
ID_Quit = 1,
ID_About,
};

//We then proceed to actually implement an event table in which the events are routed to their respective handler //functions in the class MyFrame. There are predefined macros for routing all common events, ranging from the selection //of a list box entry to a resize event when a user resizes a window on the screen. If -1 is given as the ID, the given //handler will be invoked for any event of the specified type, so that you could add just one entry in the event table //for all menu commands or all button commands etc. The origin of the event can still be distinguished in the event //handler as the (only) parameter in an event handler is a reference to a wxEvent object, which holds various information //about the event (such as the ID of and a pointer to the class, which emitted the event).

BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(ID_Quit, MyFrame::OnQuit)
EVT_MENU(ID_About, MyFrame::OnAbout)
END_EVENT_TABLE()

//As in all programs there must be a "main" function. Under wxWindows main is implemented using this macro, which creates //an application instance and starts the program.

IMPLEMENT_APP(MyApp)

//As mentioned above, wxApp::OnInit() is called upon startup and should be used to initialize the program, maybe showing //a "splash screen" and creating the main window (or several). The frame should get a title bar text ("Hello World") and //a position and start-up size. One frame can also be declared to be the top window. Returning TRUE indicates a //successful initialization.

bool MyApp::OnInit()
{
MyFrame *frame = new MyFrame( "Hello World", wxPoint(50,50), wxSize(450,340) );
frame->Show( TRUE );
SetTopWindow( frame );
return TRUE;
}

//In the constructor of the main window (or later on) we create a menu with two menu items as well as a status bar to be //shown at the bottom of the main window. Both have to be "announced" to the frame with respective calls.

MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
: wxFrame((wxFrame *)NULL, -1, title, pos, size)
{
wxMenu *menuFile = new wxMenu;

menuFile->Append( ID_About, "&About..." );
menuFile->AppendSeparator();
menuFile->Append( ID_Quit, "E&xit" );

wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append( menuFile, "&File" );

SetMenuBar( menuBar );

CreateStatusBar();
SetStatusText( "Welcome to wxWindows!" );
}

//Here are the actual event handlers. MyFrame::OnQuit() closes the main window by calling Close(). The parameter TRUE //indicates that other windows have no veto power such as after asking "Do you really want to close?". If there is no //other main window left, the application will quit.

void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
Close( TRUE );
}

//MyFrame::OnAbout() will display a small window with some text in it. In this case a typical "About" window with //information about the program.

void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxMessageBox( "This is a wxWindows' Hello world sample",
"About Hello World", wxOK | wxICON_INFORMATION );
}


я не понимаю чего он хочет, функция не определена, так там сказано что подключил wx/wx.h и все , больше ничего не надо, все в ней! =( первый опыт совсем плохо

Сообщение изменено: libricon (01 сентября 2004 - 21:54 )

  • 0
Пингвин птица гордая, пока не пнешь, не полетит!!!

#5 tomatensaft

tomatensaft

    Samurai Jack

  • Пользователь
  • 449 сообщений
  • Откуда:Tallinn

Отправлено 01 сентября 2004 - 23:00

Компилировать программу wxWidgets с помощью GCC нужно примерно так:

c++ -shared -o helloworld .wx-config --ldflags --libs --cxxflags. hworld.cpp

XRC не зависит от языка программирования. Я пользовался XRC и из wxPython. Вот пример использования XRC:

//...
wxDialog *dlg = wxXmlResource::Get()->LoadDialog(*this, "test_dialog");
dlg->ShowModal();
//...

Кстати, в этом "Hello world" все хорошо прокомментировано, так что бери словарь и переводи. И если что не понятно, можешь спрашивать.

Про wxTimer: ::GetElapsedTime() всего лишь связана с классом wxTimer, но это не значит, что она обязательно от него зависит. Эти "See also" являются просто полезными ссылками на "схожие" функции, но никак не те, которые нужно обязательно использовать. Поэтому ты можешь смело использовать GetElapsedTime() без включения <wx/timer.h> (правда, очевидно, тебе придется включить <wx/utils.h>)
  • 0
"This is all I want'd t' say 'bout dat..." © Forest Gump

#6 libricon

libricon
  • Постоялец
  • 572 сообщений
  • Откуда:Маарду

Отправлено 02 сентября 2004 - 21:34

андрей не обижайся, о не смотря на то что я чайник, я всетаки с компом немного знаком и прекрасно понимаю все что там написано и без словаря, а вот про компиляцию надо попробовать, вдруг поможет. И еще там есть примеры, но куча файлов, впринципе есть главный( ну в него все включено) вот интересно, надо в строке писать какие еще файлы надо или нет, он сам поймет по строкам типо #include <game.h> ? вот вроде и все

и п поводу этого XRC твой пример ничего мне не дал, надо что-то еще поискать или лучше пока сосредоточится мне не самом xwWIDGETS , как думаешь?
  • 0
Пингвин птица гордая, пока не пнешь, не полетит!!!

#7 libricon

libricon
  • Постоялец
  • 572 сообщений
  • Откуда:Маарду

Отправлено 02 сентября 2004 - 21:43

неполучается компиляция, он мне ничего не сказал, просто подумал и все, правдо в папке появился файл first , но он не запускается , не компилируется не реагирует на make или еще что там есть =) короче я даже пример сс пустым окном собрать не могу =(
  • 0
Пингвин птица гордая, пока не пнешь, не полетит!!!

#8 tomatensaft

tomatensaft

    Samurai Jack

  • Пользователь
  • 449 сообщений
  • Откуда:Tallinn

Отправлено 03 сентября 2004 - 09:32

Только что скомпилил эту прогу. Она компилируется без ошибок, но падает с Segmentaton fault.

Попробуй тогда так:

c++ -o helloworld .wx-config --static --ldflags --libs --cxxflags. hworld.cpp

И скажи что выдаст. У меня сказало, что не может найти библиотеку GTK... :) Тогда надо будет смотреть, что к чему...
  • 0
"This is all I want'd t' say 'bout dat..." © Forest Gump

#9 libricon

libricon
  • Постоялец
  • 572 сообщений
  • Откуда:Маарду

Отправлено 03 сентября 2004 - 15:50

вот вот , он мне тоже самое про провал написал!
говорит нет такой папки или файла( это он про lib_wx2.4.aa )чето про GTk =)
  • 0
Пингвин птица гордая, пока не пнешь, не полетит!!!

#10 tomatensaft

tomatensaft

    Samurai Jack

  • Пользователь
  • 449 сообщений
  • Откуда:Tallinn

Отправлено 03 сентября 2004 - 19:21

Я посмотрю, почему такое случается и тогда отвечу. :)
  • 0
"This is all I want'd t' say 'bout dat..." © Forest Gump

#11 libricon

libricon
  • Постоялец
  • 572 сообщений
  • Откуда:Маарду

Отправлено 03 сентября 2004 - 21:20

может из-за прекомпиляции, там где-то в статьях я видел выражение типо:" прекомпиляция для поддерживающих это машин." хотя вроде все системы это поддерживают ?
  • 0
Пингвин птица гордая, пока не пнешь, не полетит!!!

#12 libricon

libricon
  • Постоялец
  • 572 сообщений
  • Откуда:Маарду

Отправлено 03 сентября 2004 - 21:27

андрей, а не подскажешь такую вешь, вот в консоли обращение к устройствам происходт через функцию ioctl она и принимает и посылает сигнал на устройство( к примеру паралельный порт, и тот файл pprobi-1.4.0), а вот в иксах все также, прямой доступ к устройству или как в винде, через систему ? и такой вопрос, для этого служит все таже функция ioctl или что-то другое, а в wxWIDGETS если своя функция ( это же необходимо для переносимости на другие системы, а то винда не поймет что такое /dev/lp0 =))
  • 0
Пингвин птица гордая, пока не пнешь, не полетит!!!

#13 libricon

libricon
  • Постоялец
  • 572 сообщений
  • Откуда:Маарду

Отправлено 03 сентября 2004 - 21:51

так надо, скомпилировалось и даже окно появилось!
g++ hworld.cpp .wx-config --libs. .wx-config --cxxflags. -o hworld
  • 0
Пингвин птица гордая, пока не пнешь, не полетит!!!

#14 tomatensaft

tomatensaft

    Samurai Jack

  • Пользователь
  • 449 сообщений
  • Откуда:Tallinn

Отправлено 03 сентября 2004 - 22:27

Ну вот и замечательно, что запустилась.

Перекомпиляцию поддерживают не машины, а компиляторы. Вроде как, если я правильно понимаю это слово "перекомпиляция" здесь, GCC это поддерживает...

ioctl() -- это очень специфичная для Linux функция. Совершенно непереносима. Аналоги ее где-либо еще (например, для Windows) делать трудно, если не невозможно. Если тебе нужны функции низкоуровневого ввода-вывода, то выходом является написание отдельной платформо-зависимой библиотеки с определенным интерфейсом программирования (API) для каждой поддерживаемой тобой платформы и связывания ее с остальным "платформо-независимым" кодом.

Допустим, если тебе нужнна переносимая библиотека для работы с параллельным портом, пишешь под, например, Linux обобщенную библиотеку, использующую тот же механизм ioctl(). Затем выделяешь из этой библиотеки ее внешний интерфейс программирования и реализуешь его, скажем, под винду с помощью WinAPI. Можно применить и другие подходы, однако суть остается одной -- имея один и тот же API с одной и той же семантикой, реализовать его так, как это возможно на разных платформах.

В этом случае главное сформировать такой API, который будет одинаков для всех платформ. Кстати говоря, wxWidgets как раз и является в своей основной части всего лишь обобщенным единым интерфейсом программирования для всех платформ. Эта библиотека является просто промежуточным слоем между твоей программой и платформенным API.

Сообщение изменено: tomatensaft (03 сентября 2004 - 22:31 )

  • 0
"This is all I want'd t' say 'bout dat..." © Forest Gump

#15 libricon

libricon
  • Постоялец
  • 572 сообщений
  • Откуда:Маарду

Отправлено 03 сентября 2004 - 22:40

короче надо к примеру сделать файлы inout.h и inout.cpp в этих файлах сделать функцию по работе с ioctl а в самой программе использовать обращение к этой функции ?
а функции самого c++ будут работать в wxWIDGETS ?
  • 0
Пингвин птица гордая, пока не пнешь, не полетит!!!

#16 tomatensaft

tomatensaft

    Samurai Jack

  • Пользователь
  • 449 сообщений
  • Откуда:Tallinn

Отправлено 04 сентября 2004 - 00:06

Нечто подобное по духу (продумай хорошо интерфейс, этот вряд ли вообще будет полезен в реальности):

parport_io.h
/*
 * A common API for interaction with hardware through parallel port. 
 * Sept 2004, Me, my favourite :)
 * (public domain)
 */
int write(const char *s, int len);
int read(const char *, int len);

parport.cpp соответственно реализует этот интерфейс. Твое дело -- мешать код для разных платформ в одном файле, или делать какие-то особые манипуляции с разными файлами исходников во время компиляции (например, класть все исходники для Linux в папку ./linux/, а для Windows -- в папку ./win32/)...

*** В любом случае, на этом уровне тебе потребуется более-менее нормальная среда разработки. Каждый файл компилить вручную с помощью непосредственно GCC -- это гемор, лучше воспользоваться чем-то вроде autoconf/automake, cmake, ant, и тому подобного для генерации Makefile-ов. Хотя бы. Рекомендую воспользоваться autoproject. Научишься пользоваться automake/autoconf... Для кросс-платформенной разработки хорош cmake (кстати, в нем есть специальная поддержка для wxWidgets, что делает управление проектом с ним очень удобным).

/*
 * Implementation of the parport_io API
 */
#ifdef __linux__
#include <sys/ioctl.h>
#endif

//...

int write (const char*s, int len)
{
  // ioctl(...); и др.
}

int read (const char *s, int len)
{
  // ioctl(...); и др.
}

Функции Стандартной библиотеки C++, безусловно, работают и с wxWidgets. Точнее, наоборот, wxWidgets совместим со стандартной библиотекой C++, в том числе, с STL, по крайней мере, на уровне совместного использования.


То есть, такого вида код будет без проблем компилироваться и работать:

#include <wx/wx.h>
#include <wx/window.h>
#include <iostream>
#include <string>
#include <map>


void func(const std::string& str, wxWindow *w){
  using namespace std;
  map<string, wxWindow*> mapping;
  cout << "Hello world" 
         << w->GetSomeString().c_str()  // возвращает wxString, конвертим в const char*
         << endl;
  // манипуляции...
}

Сообщение изменено: tomatensaft (04 сентября 2004 - 00:18 )

  • 0
"This is all I want'd t' say 'bout dat..." © Forest Gump

#17 libricon

libricon
  • Постоялец
  • 572 сообщений
  • Откуда:Маарду

Отправлено 04 сентября 2004 - 21:56

ясно, аутомака у меня нет, а вот ауто конф есть =) аутопроетка тоже , жаль!
  • 0
Пингвин птица гордая, пока не пнешь, не полетит!!!

#18 tomatensaft

tomatensaft

    Samurai Jack

  • Пользователь
  • 449 сообщений
  • Откуда:Tallinn

Отправлено 05 сентября 2004 - 10:04

Дык, установи. autoconf бесмысленен без automake. А autoproject можно скачать с sourceforge.org :)
  • 0
"This is all I want'd t' say 'bout dat..." © Forest Gump

#19 libricon

libricon
  • Постоялец
  • 572 сообщений
  • Откуда:Маарду

Отправлено 05 сентября 2004 - 23:50

бык, откуда качать? сам найду, не копашись, а там в статье былосказано: (перевод без словаря) лучший способ сделать маке файл, это взять его из ****(папка) и переделать под свой проект =) коней цитаты.
  • 0
Пингвин птица гордая, пока не пнешь, не полетит!!!

#20 tomatensaft

tomatensaft

    Samurai Jack

  • Пользователь
  • 449 сообщений
  • Откуда:Tallinn

Отправлено 06 сентября 2004 - 06:54

Возиться с Makefile-ами вручную довольно-таки геморно. Хотя для простых проектов вполне сойдет, когда программа станет сложной, возникнут проблемы. Кроме того, Makefile-ы практически непереносимы (если переносимость -- одна из целей разработки).

Качать -- оттуда же, откуда ты качал другие пакеты для своего дистрибутива. automake является стандартным во всех дистрах общего назначения.

Сообщение изменено: tomatensaft (06 сентября 2004 - 06:56 )

  • 0
"This is all I want'd t' say 'bout dat..." © Forest Gump

#21 libricon

libricon
  • Постоялец
  • 572 сообщений
  • Откуда:Маарду

Отправлено 06 сентября 2004 - 15:49

я сделал полную установку, там больше ничего нет
  • 0
Пингвин птица гордая, пока не пнешь, не полетит!!!

#22 tomatensaft

tomatensaft

    Samurai Jack

  • Пользователь
  • 449 сообщений
  • Откуда:Tallinn

Отправлено 07 сентября 2004 - 07:29

Значит, у тебя должен быть automake. Поверь мне, без него Linux -- не Linux.
  • 0
"This is all I want'd t' say 'bout dat..." © Forest Gump

#23 libricon

libricon
  • Постоялец
  • 572 сообщений
  • Откуда:Маарду

Отправлено 07 сентября 2004 - 15:40

whereis automake . блин и впраду есть =)
  • 0
Пингвин птица гордая, пока не пнешь, не полетит!!!