wxBitmapCheckBox and wxBitmapRadioButton
-
- Earned some good credits
- Posts: 113
- Joined: Mon May 09, 2005 5:11 am
- Location: Argentina - BS AS
wxBitmapCheckBox and wxBitmapRadioButton
Hi!!! well, i finish this two classes. I m actually a newbie and these are the fisrt components that i ve ever wrote, so please if you think that something is wrong or there can be improvements (which i m sure there must be) let me know.
I hope this can help somebody, as for the utilty of he clases or as model to create components with custom events (that was the hardest part to get for me).
So thnx to this greate forum, and again, critisize all u think, it would really help me.
I hope this can help somebody, as for the utilty of he clases or as model to create components with custom events (that was the hardest part to get for me).
So thnx to this greate forum, and again, critisize all u think, it would really help me.
Just a newbie - Too many interests, not too many time.
Windows XP SP2
Kubuntu GNU/Linux - Feisty
wxActiveRecordGenerator (aka wxARG) maintainer
Find it at wxCode
Windows XP SP2
Kubuntu GNU/Linux - Feisty
wxActiveRecordGenerator (aka wxARG) maintainer
Find it at wxCode
-
- Earned some good credits
- Posts: 113
- Joined: Mon May 09, 2005 5:11 am
- Location: Argentina - BS AS
Here are the codes:....
Code: Select all
/////////////////////////////////////////////////////////////////////////////
// Name: BitmapCheckBox.h
// Author: Mat
Last edited by Ugly! on Fri Aug 12, 2005 1:44 pm, edited 1 time in total.
Just a newbie - Too many interests, not too many time.
Windows XP SP2
Kubuntu GNU/Linux - Feisty
wxActiveRecordGenerator (aka wxARG) maintainer
Find it at wxCode
Windows XP SP2
Kubuntu GNU/Linux - Feisty
wxActiveRecordGenerator (aka wxARG) maintainer
Find it at wxCode
-
- Earned some good credits
- Posts: 113
- Joined: Mon May 09, 2005 5:11 am
- Location: Argentina - BS AS
Please post the compiler errors for the EVT_BMPRADIOBUTTON and what compiler r you using? what version of wxwidgets? platform???bobmanc wrote:Graphically it is working great but I can't get the EVT_BMPRADIOBUTTON code to compile. What should that look like? Also is there a way to specify a range like in EVT_MENU_RANGE?
Thanks a lot.
(I had no problem using vc++ 6.0 with wxwidgets 2.6.1 and wx-devcpp 6.7, i have not tried in linux because my linux boxis not working right now)
About EVT_MENU_RANGE i think it could be implemented easely so i ll do it sometime tonight or tomorrow, or you can try to implemented ur self and post the code here.
Regards...
Just a newbie - Too many interests, not too many time.
Windows XP SP2
Kubuntu GNU/Linux - Feisty
wxActiveRecordGenerator (aka wxARG) maintainer
Find it at wxCode
Windows XP SP2
Kubuntu GNU/Linux - Feisty
wxActiveRecordGenerator (aka wxARG) maintainer
Find it at wxCode
I ran Boundschecker on it and added this line to stop a memory leak.
wxBitmapRadioGroup::~wxBitmapRadioGroup(){
while(group->GetCount()>0)
group->RemoveAt(0);
delete group; //<===== added this line
}
It also complains about this line. Don't know what to do about that though.
WX_DEFINE_ARRAY(wxBitmapRadioButton *,radioArray);
C:\projects\BitmapRadioButton.h(51) : warning C4284: return type for 'radioArray::reverse_iterator::operator ->' is 'class wxBitmapRadioButton ** ' (ie; not a UDT or referenc
e to a UDT. Will produce errors if applied using infix notation)
wxBitmapRadioGroup::~wxBitmapRadioGroup(){
while(group->GetCount()>0)
group->RemoveAt(0);
delete group; //<===== added this line
}
It also complains about this line. Don't know what to do about that though.
WX_DEFINE_ARRAY(wxBitmapRadioButton *,radioArray);
C:\projects\BitmapRadioButton.h(51) : warning C4284: return type for 'radioArray::reverse_iterator::operator ->' is 'class wxBitmapRadioButton ** ' (ie; not a UDT or referenc
e to a UDT. Will produce errors if applied using infix notation)
-
- Earned some good credits
- Posts: 113
- Joined: Mon May 09, 2005 5:11 am
- Location: Argentina - BS AS
THNX FOR THE FEEDBACK, i corrected that memory leak.
I think this is just a warning, nothing big.bobmanc wrote: It also complains about this line. Don't know what to do about that though.
WX_DEFINE_ARRAY(wxBitmapRadioButton *,radioArray);
C:\projects\BitmapRadioButton.h(51) : warning C4284: return type for 'radioArray::reverse_iterator::operator ->' is 'class wxBitmapRadioButton ** ' (ie; not a UDT or referenc
e to a UDT. Will produce errors if applied using infix notation)
Just a newbie - Too many interests, not too many time.
Windows XP SP2
Kubuntu GNU/Linux - Feisty
wxActiveRecordGenerator (aka wxARG) maintainer
Find it at wxCode
Windows XP SP2
Kubuntu GNU/Linux - Feisty
wxActiveRecordGenerator (aka wxARG) maintainer
Find it at wxCode
Hi ,
I try to compile the BitmapCheckBox, but it hit the below error.
Can you help ?
I am using wxWidget 2.8.3 on MS Studio 8 on window XP.
Regards
Teh
1>Compiling...
1>bitmapcheckbox.cpp
1>c:\dev\cafesql\gui\bitmapcheckbox.h(109) : error C2143: syntax error : missing ')' before ','
1>c:\dev\cafesql\gui\bitmapcheckbox.h(109) : error C2373: 'wxEVT_BMPCHECKBOX_CLICKED' : redefinition; different type modifiers
1> c:\dev\cafesql\gui\bitmapcheckbox.h(102) : see declaration of 'wxEVT_BMPCHECKBOX_CLICKED'
1>c:\dev\cafesql\gui\bitmapcheckbox.h(109) : error C2512: 'wxEventTableEntry' : no appropriate default constructor available
1>c:\dev\cafesql\gui\bitmapcheckbox.h(109) : error C2512: 'wxEventTableEntry' : no appropriate default constructor available
1>c:\dev\cafesql\gui\bitmapcheckbox.h(109) : error C2059: syntax error : '-'
1>c:\dev\cafesql\gui\bitmapcheckbox.h(109) : error C2017: illegal escape sequence
1>c:\dev\cafesql\gui\bitmapcheckbox.h(109) : error C2017: illegal escape sequence
1>c:\dev\cafesql\gui\bitmapcheckbox.h(109) : error C2059: syntax error : ')'
1>c:\dev\cafesql\gui\bitmapcheckbox.cpp(17) : error C2143: syntax error : missing ';' before '{'
1>c:\dev\cafesql\gui\bitmapcheckbox.cpp(17) : error C2447: '{' : missing function header (old-style formal list?)
I try to compile the BitmapCheckBox, but it hit the below error.
Can you help ?
I am using wxWidget 2.8.3 on MS Studio 8 on window XP.
Regards
Teh
1>Compiling...
1>bitmapcheckbox.cpp
1>c:\dev\cafesql\gui\bitmapcheckbox.h(109) : error C2143: syntax error : missing ')' before ','
1>c:\dev\cafesql\gui\bitmapcheckbox.h(109) : error C2373: 'wxEVT_BMPCHECKBOX_CLICKED' : redefinition; different type modifiers
1> c:\dev\cafesql\gui\bitmapcheckbox.h(102) : see declaration of 'wxEVT_BMPCHECKBOX_CLICKED'
1>c:\dev\cafesql\gui\bitmapcheckbox.h(109) : error C2512: 'wxEventTableEntry' : no appropriate default constructor available
1>c:\dev\cafesql\gui\bitmapcheckbox.h(109) : error C2512: 'wxEventTableEntry' : no appropriate default constructor available
1>c:\dev\cafesql\gui\bitmapcheckbox.h(109) : error C2059: syntax error : '-'
1>c:\dev\cafesql\gui\bitmapcheckbox.h(109) : error C2017: illegal escape sequence
1>c:\dev\cafesql\gui\bitmapcheckbox.h(109) : error C2017: illegal escape sequence
1>c:\dev\cafesql\gui\bitmapcheckbox.h(109) : error C2059: syntax error : ')'
1>c:\dev\cafesql\gui\bitmapcheckbox.cpp(17) : error C2143: syntax error : missing ';' before '{'
1>c:\dev\cafesql\gui\bitmapcheckbox.cpp(17) : error C2447: '{' : missing function header (old-style formal list?)
Events?
Hi I tryed this to get working but I got this linker error:
Linking executable: bin\button.exe
obj\buttonMain.o: In function `Z41__static_initialization_and_destruction_0ii':E:/pokus/button/buttonMain.cpp:56: undefined reference to `buttonFrame::OnCheck(wxBmpCheckBoxEvent&)'
collect2: ld returned 1 exit status
Using wxWidgets 2.8 on winXP.
Thanks for any tips.. This component looks ideal for my solution and I really want to get it working.
Linking executable: bin\button.exe
obj\buttonMain.o: In function `Z41__static_initialization_and_destruction_0ii':E:/pokus/button/buttonMain.cpp:56: undefined reference to `buttonFrame::OnCheck(wxBmpCheckBoxEvent&)'
collect2: ld returned 1 exit status
Using wxWidgets 2.8 on winXP.
Code: Select all
BEGIN_EVENT_TABLE(buttonFrame, wxFrame)
EVT_CLOSE(buttonFrame::OnClose)
EVT_MENU(idMenuQuit, buttonFrame::OnQuit)
EVT_MENU(idMenuAbout, buttonFrame::OnAbout)
EVT_BMPCHECKBOX(1010,buttonFrame::OnCheck)
//EVT_BMPRADIOBUTTON(1011,buttonFrame::radioChanged1)
//EVT_BMPRADIOBUTTON(1012,buttonFrame::radioChanged2)
END_EVENT_TABLE()
Code: Select all
wxBitmap bsrc1 = wxBitmap(wxT("src1"),wxBITMAP_TYPE_BMP_RESOURCE);
wxBitmap bsrc2 = wxBitmap(wxT("src2"),wxBITMAP_TYPE_BMP_RESOURCE);
btn1=new wxBitmapCheckBox(this,1010,&bsrc1,&bsrc2,PUSH_LIKE,wxPoint(170,160));
Code: Select all
void OnCheck(wxBmpCheckBoxEvent& event){
}
-
- In need of some credit
- Posts: 2
- Joined: Wed Mar 05, 2008 3:02 pm
Hello all, I got a question not very specific to this topic but that is however in some way related.
I used some instances of wxBitmapCheckBox class in my design and I created them with the wxDefaultPosition parameter.
I add it a bit later in a sizer (in the fane Frame of my app), and then Layout() the sizer.
The result of this is at the launching of the app my bitmap drawn at position (0,0) and staying there untill I click on the checkBox. If I create it with the position (3000,2000), there's still a hole on my window at the CheckBox' position in the sizer.
If someone has an idea or a trick I didn't see to solve this.. I'd be glad!
Thanks,
Tom.
I used some instances of wxBitmapCheckBox class in my design and I created them with the wxDefaultPosition parameter.
I add it a bit later in a sizer (in the fane Frame of my app), and then Layout() the sizer.
The result of this is at the launching of the app my bitmap drawn at position (0,0) and staying there untill I click on the checkBox. If I create it with the position (3000,2000), there's still a hole on my window at the CheckBox' position in the sizer.
If someone has an idea or a trick I didn't see to solve this.. I'd be glad!
Thanks,
Tom.
Re: wxBitmapCheckBox and wxBitmapRadioButton
Hi,
Please I am working with wxGTK3.0.0 and I would like to use wxBitmapCheckBox, can you please send me the code ?
Thanks
Mahmoud
Please I am working with wxGTK3.0.0 and I would like to use wxBitmapCheckBox, can you please send me the code ?
Thanks
Mahmoud