Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XRC generates object class="unknown" name="dataViewListCtrlLog" #771

Open
wjhutton opened this issue Feb 9, 2023 · 3 comments
Open

XRC generates object class="unknown" name="dataViewListCtrlLog" #771

wjhutton opened this issue Feb 9, 2023 · 3 comments

Comments

@wjhutton
Copy link

wjhutton commented Feb 9, 2023

Operating system: WIndows 10 Version: 10.0.10011.16384
wxPython version & source: 4.2.0 installed with pip

Python version & source: Python 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 bit (AMD64)] on win32
Description of the problem:

The program and xrc files created by wxFormbuilder 3.10.1

python code
self.dataViewListCtrlLog = wx.dataview.DataViewListCtrl( self.panelMain, wx.ID_ANY, wx.DefaultPosition, wx.Size( 280,180 ), 0 )

xrc code has an error Search for "unknown"

Code Example (click to expand)
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
	<object class="wxFrame" name="FrameMain">
		<style>wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL</style>
		<size>500,300</size>
		<title>List control demo</title>
		<centered>1</centered>
		<aui_managed>0</aui_managed>
		<object class="wxBoxSizer">
			<orient>wxVERTICAL</orient>
			<object class="sizeritem">
				<option>1</option>
				<flag>wxEXPAND | wxALL</flag>
				<border>5</border>
				<object class="wxPanel" name="panelMain">
					<style>wxTAB_TRAVERSAL</style>
					<object class="wxGridBagSizer">
						<vgap>0</vgap>
						<hgap>0</hgap>
						<growablecols></growablecols>
						<growablerows></growablerows>
						<object class="sizeritem">
							<cellpos>0,0</cellpos>
							<cellspan>1,1</cellspan>
							<flag>wxEXPAND</flag>
							<border>5</border>
							<object class="wxGridBagSizer">
								<vgap>0</vgap>
								<hgap>0</hgap>
								<growablecols></growablecols>
								<growablerows></growablerows>
								<object class="sizeritem">
									<cellpos>0,0</cellpos>
									<cellspan>1,1</cellspan>
									<flag>wxALL</flag>
									<border>5</border>
									<object class="unknown" name="dataViewListCtrlLog" />
								</object>
							</object>
						</object>
						<object class="sizeritem">
							<cellpos>0,1</cellpos>
							<cellspan>1,1</cellspan>
							<flag>wxEXPAND</flag>
							<border>5</border>
							<object class="wxGridBagSizer">
								<vgap>0</vgap>
								<hgap>0</hgap>
								<growablecols></growablecols>
								<growablerows></growablerows>
								<object class="sizeritem">
									<cellpos>0,0</cellpos>
									<cellspan>1,1</cellspan>
									<flag>wxALL</flag>
									<border>5</border>
									<object class="wxButton" name="butnAdd">
										<font>
											<size>8</size>
											<style>normal</style>
											<weight>normal</weight>
											<underlined>0</underlined>
										</font>
										<label>Add</label>
										<default>0</default>
										<auth_needed>0</auth_needed>
										<markup>0</markup>
										<bitmap />
									</object>
								</object>
								<object class="sizeritem">
									<cellpos>3,0</cellpos>
									<cellspan>1,1</cellspan>
									<flag>wxALL</flag>
									<border>5</border>
									<object class="wxButton" name="buttonDel">
										<label>Delete</label>
										<default>0</default>
										<auth_needed>0</auth_needed>
										<markup>0</markup>
										<bitmap />
									</object>
								</object>
								<object class="sizeritem">
									<cellpos>1,0</cellpos>
									<cellspan>1,1</cellspan>
									<flag>wxALL</flag>
									<border>5</border>
									<object class="wxButton" name="butnEdit">
										<label>Edit</label>
										<default>0</default>
										<auth_needed>0</auth_needed>
										<markup>0</markup>
										<bitmap />
									</object>
								</object>
							</object>
						</object>
					</object>
				</object>
			</object>
		</object>
	</object>
</resource>
<details>
@sodevel
Copy link
Member

sodevel commented Feb 14, 2023

Components for which wxFB does not contain XRC import or export code get exported as unknown class. There are two possible reasons why wxFB does not contain such code, either because XRC does not support this control or because no one has added such code to wxFB. Looking at the current XRC file format, it has some very limited support for this control, basically it only supports the control itself but not any added columns.

@wjhutton
Copy link
Author

wjhutton commented Feb 17, 2023 via email

@sodevel
Copy link
Member

sodevel commented Feb 20, 2023

XRC != code. XRC is a declarative way to describe GUIs but offers much less functionality than code.

Your use case you described above is, according to the documentation i linked in my last post, currently not possible to realize because this feature is not available in wxWidgets itself. So, to get your use case done, first wxWidgets must be updated. Then these changes must be ported to wxPython. And as the last step wxFB must be updated.

Right now, your use case can only be done by code.

I can't say anything about your wxPython issues, i don't do any Python. The best i could do right now is, add XRC support for what is currently possible, that is the control itself together with basic properties like style flags. However, i currently don't have the time for this, so PRs welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants