Talk:VGUI2: Creating a panel: Difference between revisions
Jump to navigation
Jump to search
(solution??) |
|||
Line 23: | Line 23: | ||
- name your file '''CMyPanel.cpp''' not a '''MyPanel.cpp''' | - name your file '''CMyPanel.cpp''' not a '''MyPanel.cpp''' | ||
- add following headers: | - add following headers: | ||
< | <cpp> | ||
#include "cbase.h" | #include "cbase.h" | ||
#include "IMyPanel.h" | #include "IMyPanel.h" | ||
Line 31: | Line 31: | ||
#include <vgui/IVGui.h> | #include <vgui/IVGui.h> | ||
#include <vgui_controls/Frame.h> | #include <vgui_controls/Frame.h> | ||
</ | </cpp> | ||
- comment following virtual functions (there is no definition??): | - comment following virtual functions (there is no definition??): | ||
< | <cpp> | ||
// virtual void OnTick(); | // virtual void OnTick(); | ||
// virtual void OnCommand(const char* pcCommand); | // virtual void OnCommand(const char* pcCommand); | ||
</ | </cpp> |
Revision as of 19:11, 30 April 2006
Hopefully somebody will reformat the text. Btw.: There is still no <cpp> tag!
Text reformatted. --AiusEpsi 15:19, 3 Jul 2005 (PDT)
- There is a <code> tag. MightyMooquack 15:32, 3 Jul 2005 (PDT)
- And a cpp tag is much cooler: It has C++ syntax highlighting. Examples: SourceWiki.org --Leon Grapenthin 09:35, 6 Jul 2005 (PDT)
- Is SourceWiki down? Because I can't access it anymore --Pon
- And a cpp tag is much cooler: It has C++ syntax highlighting. Examples: SourceWiki.org --Leon Grapenthin 09:35, 6 Jul 2005 (PDT)
Has anybody been able to follow this and get it to work? I'm having trouble and getting a error...
MyPanel.cpp(78) : fatal error C1010: unexpected end of file while looking for precompiled header directive
I tried compiling it after the modification to vgui_int.cpp when it says to run the game. Anybody having the same problem or am I just royally screwing up?
you need to #include "cbase.h" Ts2do
solution??
This is how I solved the previous problem: - name your file CMyPanel.cpp not a MyPanel.cpp - add following headers: <cpp>
- include "cbase.h"
- include "IMyPanel.h"
using namespace vgui;
- include <vgui/IVGui.h>
- include <vgui_controls/Frame.h>
</cpp>
- comment following virtual functions (there is no definition??): <cpp> // virtual void OnTick(); // virtual void OnCommand(const char* pcCommand); </cpp>