Struct GridListBox3D

pub struct GridListBox3D(/* private fields */);
Expand description

Use the Grid List %Box 3D node to create scrollable lists of 3D items arranged in a grid.

To set the size of the grid cells, use the CellWidthProperty and CellHeightProperty properties in the Grid List %Box 3D node. All cells in a Grid List %Box 3D node are of the same size.

The size of a Grid List %Box 3D node determines the number of rows and columns: a Grid List %Box 3D node shows as many cells as fit within its area. Kanzi hides the list items that are in cells that do not fit in the list box area. The user can scroll the list box to see more items. The user can temporarily drag list items out of the grid, but when the user is not providing input, the list box scrolls the items back to the grid area.

To handle input, the Grid List %Box 3D internally uses ScrollView3D. To make the input work:

  • Position the Grid List %Box 3D in front of the camera oriented so that the scroll plane is perpendicular to the camera view ray.
  • Set the size of the Grid List %Box 3D. The scroll view uses that area to collect input.

To configure the scroll view, Kanzi internally binds the properties that you set in the Grid List %Box 3D to the corresponding properties in the scroll view. You can send to a Grid List %Box 3D node ScrollViewConcept messages, such as ScrollViewConcept::ScrollDirectionMessage, ScrollViewConcept::ScrollPageMessage, and ScrollViewConcept::ScrollUpMessage.

See: ListBoxConceptImpl

§Examples

To create a Grid List %Box 3D node:

To configure the grid area:

To add items to the list box:

Implementations§

§

impl GridListBox3D

pub fn create( domain: &Domain, name: impl AsRef<KanziStr>, ) -> Result<GridListBox3D, Error>

Creates a Grid List %Box 3D node.

§Arguments
  • domain - The UI domain to which the node belongs.
  • name - The name of the node.
§

impl GridListBox3D

pub fn set_item_generator( &self, item_generator: Option<&ListBoxItemGenerator3D>, ) -> Result<(), Error>

Sets the list box item generator.

§Arguments
  • item_generator - New item generator.

Methods from Deref<Target = Node3D>§

pub fn get_layout_transformation(&self) -> Result<SRTValue3D, Error>

pub fn set_layout_transformation(&self, value: SRTValue3D) -> Result<(), Error>

pub fn get_render_transformation(&self) -> Result<SRTValue3D, Error>

pub fn set_render_transformation(&self, value: SRTValue3D) -> Result<(), Error>

pub fn get_final_transformation(&self) -> Result<Matrix4x4, Error>

pub fn set_final_transformation(&self, value: Matrix4x4) -> Result<(), Error>

pub fn get_frustum_cull_margin(&self) -> Result<f32, Error>

pub fn set_frustum_cull_margin(&self, value: f32) -> Result<(), Error>

pub fn has_child(&self, child: &Node) -> Result<bool, Error>

Returns whether the given node is a child of this node.

pub fn get_child_count(&self) -> Result<u64, Error>

Gets the number of children of the node.

pub fn get_child(&self, index: u64) -> Result<Weak<Node3D>, Error>

Returns a child from given index from object node.

§Errors

Returns an INDEX_OUT_OF_BOUNDS error if the index is out of bounds.

pub unsafe fn get_child_unchecked( &self, index: u64, ) -> Result<Weak<Node3D>, Error>

Returns a child from given index from object node.

§Safety

The caller must ensure that index < self.get_child_count().

pub fn get_child_index(&self, child: &Node) -> Result<u64, Error>

Returns the index of a child in an object node.

§Errors

Returns an INVALID_ARGUMENT error if the provided Node3D is not a child of self.

pub unsafe fn get_child_index_unchecked( &self, child: &Node, ) -> Result<u64, Error>

Returns the index of a child in an object node.

§Safety

The caller must ensure that self.has_child(child).

pub fn add_child(&self, child: &Node3D) -> Result<(), Error>

Adds a child node to a 3D node.

pub fn insert_child(&self, index: u64, child: &Node3D) -> Result<(), Error>

Adds a child node for object node to given index.

§Errors

Returns an INDEX_OUT_OF_BOUNDS error if the index is out of bounds.

pub fn remove_child(&self, child: &Node3D) -> Result<(), Error>

Removes child node.

§Errors

Returns an INVALID_ARGUMENT error if the provided Node3D is not a child of self.

pub unsafe fn remove_child_unchecked(&self, child: &Node3D) -> Result<(), Error>

Removes child node.

§Safety

The caller must ensure that self.has_child(child).

pub fn remove_child_at_index(&self, index: u64) -> Result<(), Error>

Removes child node at specified index.

§Errors

Returns an INDEX_OUT_OF_BOUNDS error if the index is out of bounds.

pub unsafe fn remove_child_at_index_unchecked( &self, index: u64, ) -> Result<(), Error>

Removes child node at specified index.

§Safety

The caller must ensure that index < self.get_child_count().

pub fn remove_all_children(&self) -> Result<(), Error>

Removes all child nodes.

pub fn move_to_back(&self) -> Result<(), Error>

Repositions a 3D node to the beginning of the list of child nodes of its parent node, so that Kanzi draws the node first.

pub fn move_to_front(&self) -> Result<(), Error>

Repositions a 3D node to the end of the list of child nodes of its parent node, so that Kanzi draws the node last.

pub fn get_core_desired_size(&self) -> Result<Vector3, Error>

Returns the core desired size of a 3D node.

pub fn set_core_desired_size(&self, value: Vector3) -> Result<(), Error>

Sets the core desired size of a 3D node.

pub fn get_desired_size(&self) -> Result<Vector3, Error>

Returns the desired size of a 3D node.

pub fn set_desired_size(&self, value: Vector3) -> Result<(), Error>

Sets the desired size of a 3D node.

pub fn get_allocated_size(&self) -> Result<Vector3, Error>

Returns the allocated size of a 3D node.

pub fn set_allocated_size(&self, value: Vector3) -> Result<(), Error>

Sets the allocated size of a 3D node.

pub fn get_actual_size(&self) -> Result<Vector3, Error>

Returns the actual size of a 3D node.

pub fn set_actual_size(&self, value: Vector3) -> Result<(), Error>

Sets the actual size of a 3D node.

pub fn set_layout_bounding_box_size( &self, bbox_min: Vector3, bbox_max: Vector3, ) -> Result<(), Error>

Sets the size of the bounding box of a 3D node.

pub fn get_layout_bounding_box_min(&self) -> Result<Vector3, Error>

Returns the min size of the bounding box of a 3D node.

pub fn get_layout_bounding_box_max(&self) -> Result<Vector3, Error>

Returns the max size of the bounding box of a 3D node.

pub fn set_allocated_offset( &self, allocated_offset: Vector3, ) -> Result<(), Error>

Sets the allocated offset of a 3D node.

pub fn get_allocated_offset(&self) -> Result<Vector3, Error>

Returns the allocated offset of a 3D node.

pub fn set_stretch_scale(&self, stretch_scale: Vector3) -> Result<(), Error>

Sets the stretch scale of a 3D node.

pub fn get_stretch_scale(&self) -> Result<Vector3, Error>

Returns the stretch scale of a 3D node.

pub fn set_pivot_offset(&self, pivot_offset: Vector3) -> Result<(), Error>

Sets the pivot offset of a 3D node.

pub fn get_pivot_offset(&self) -> Result<Vector3, Error>

Returns the pivot offset of a 3D node.

pub fn get_size(&self) -> Result<Vector3, Error>

Returns the size of a 3D node.

pub fn get_maximum_bounding_box_coordinates(&self) -> Result<Vector3, Error>

Returns the maximum coordinates for the bounding volume of a 3D node.

pub fn get_minimum_bounding_box_coordinates(&self) -> Result<Vector3, Error>

Returns the minimum coordinates for the bounding volume of a 3D node.

pub fn get_arrange_transform(&self) -> Result<Matrix4x4, Error>

Returns the layout transformation of a 3D node.

pub fn set_arrange_transform(&self, value: Matrix4x4) -> Result<(), Error>

Sets the layout transformation of a 3D node.

pub fn layout(&self) -> Result<(), Error>

Calculates the layouts in a scene recursively. Calls the measure and arrange functions of every 3D node in the scene.

pub fn measure(&self, available_size: Vector3) -> Result<(), Error>

Performs the default measure step.

pub fn arrange(&self) -> Result<(), Error>

Performs layout arrangement on a 3D node.

pub fn centered_measure( &self, available_size: Vector3, ) -> Result<Vector3, Error>

Default implementation of measure for a layout that accommodates all children at its center.

pub fn centered_arrange(&self, actual_size: Vector3) -> Result<(), Error>

Default implementation of arrange for a layout that accommodates all children at its center.

pub fn is_primitive_layout(&self) -> Result<bool, Error>

Indicates whether a 3D node has primitive layout behavior.

pub fn get_look_at_target(&self) -> Result<Option<Weak<Node3D>>, Error>

pub fn get_position_constraint_target( &self, ) -> Result<Option<Weak<Node3D>>, Error>

pub fn get_orientation_constraint_target( &self, ) -> Result<Option<Weak<Node3D>>, Error>

pub fn get_face_to_camera_target(&self) -> Result<Option<Weak<Node3D>>, Error>

pub fn look_at( &self, position: Vector3, look_at_point: Vector3, up_vector: Vector3, ) -> Result<(), Error>

Sets node transformation so that the node is in a given position turned toward a given point.

§Arguments
  • node - The node to which to apply the transformation.
  • position - The translation to apply to the node.
  • look_at_point - The point toward which the node turns.
  • up_vector - The up vector to set for the node.

pub fn get_children_iterator(&self) -> Result<Node3DChildrenIterator, Error>

Gets an iterator over 3D node children.

pub fn get_children(&self) -> Result<Vec<Weak<Node3D>>, Error>

Gets a list of 3D node children.

pub fn get_children_rev_iterator(&self) -> Result<Node3DChildrenIterator, Error>

Gets a reverse iterator over 3D node children.

pub fn get_children_rev(&self) -> Result<Vec<Weak<Node3D>>, Error>

Gets a reverse list of 3D node children.

Methods from Deref<Target = Node>§

pub fn get_name(&self) -> Result<KanziString, Error>

pub fn set_name(&self, value: impl AsRef<KanziStr>) -> Result<(), Error>

pub fn get_path(&self) -> Result<KanziString, Error>

pub fn set_path(&self, value: impl AsRef<KanziStr>) -> Result<(), Error>

pub fn get_locale(&self) -> Result<KanziString, Error>

pub fn set_locale(&self, value: impl AsRef<KanziStr>) -> Result<(), Error>

pub fn get_width(&self) -> Result<f32, Error>

pub fn set_width(&self, value: f32) -> Result<(), Error>

pub fn get_height(&self) -> Result<f32, Error>

pub fn set_height(&self, value: f32) -> Result<(), Error>

pub fn get_depth(&self) -> Result<f32, Error>

pub fn set_depth(&self, value: f32) -> Result<(), Error>

pub fn get_actual_width(&self) -> Result<f32, Error>

pub fn set_actual_width(&self, value: f32) -> Result<(), Error>

pub fn get_actual_height(&self) -> Result<f32, Error>

pub fn set_actual_height(&self, value: f32) -> Result<(), Error>

pub fn get_actual_depth(&self) -> Result<f32, Error>

pub fn set_actual_depth(&self, value: f32) -> Result<(), Error>

pub fn get_horizontal_alignment(&self) -> Result<HorizontalAlignment, Error>

pub fn set_horizontal_alignment( &self, value: HorizontalAlignment, ) -> Result<(), Error>

pub fn get_vertical_alignment(&self) -> Result<VerticalAlignment, Error>

pub fn set_vertical_alignment( &self, value: VerticalAlignment, ) -> Result<(), Error>

pub fn get_depth_alignment(&self) -> Result<DepthAlignment, Error>

pub fn set_depth_alignment(&self, value: DepthAlignment) -> Result<(), Error>

pub fn get_horizontal_margin(&self) -> Result<Vector2, Error>

pub fn set_horizontal_margin(&self, value: Vector2) -> Result<(), Error>

pub fn get_vertical_margin(&self) -> Result<Vector2, Error>

pub fn set_vertical_margin(&self, value: Vector2) -> Result<(), Error>

pub fn get_depth_margin(&self) -> Result<Vector2, Error>

pub fn set_depth_margin(&self, value: Vector2) -> Result<(), Error>

pub fn get_hit_testable(&self) -> Result<bool, Error>

pub fn set_hit_testable(&self, value: bool) -> Result<(), Error>

pub fn get_hit_testable_container(&self) -> Result<bool, Error>

pub fn set_hit_testable_container(&self, value: bool) -> Result<(), Error>

pub fn get_visible(&self) -> Result<bool, Error>

pub fn set_visible(&self, value: bool) -> Result<(), Error>

pub fn get_enabled(&self) -> Result<bool, Error>

pub fn set_enabled(&self, value: bool) -> Result<(), Error>

pub fn get_effectively_enabled(&self) -> Result<bool, Error>

pub fn set_effectively_enabled(&self, value: bool) -> Result<(), Error>

pub fn get_focusable(&self) -> Result<bool, Error>

pub fn set_focusable(&self, value: bool) -> Result<(), Error>

pub fn get_focused(&self) -> Result<bool, Error>

pub fn set_focused(&self, value: bool) -> Result<(), Error>

pub fn get_focus_state(&self) -> Result<FocusState, Error>

pub fn set_focus_state(&self, value: FocusState) -> Result<(), Error>

pub fn get_font_family(&self) -> Result<Option<Weak<Resource>>, Error>

pub fn set_font_family(&self, value: Option<&Resource>) -> Result<(), Error>

pub fn get_visible_amount_in_parent(&self) -> Result<f32, Error>

pub fn set_visible_amount_in_parent(&self, value: f32) -> Result<(), Error>

pub fn get_clip_children(&self) -> Result<bool, Error>

pub fn set_clip_children(&self, value: bool) -> Result<(), Error>

pub fn get_content_stretch(&self) -> Result<ContentStretch, Error>

pub fn set_content_stretch(&self, value: ContentStretch) -> Result<(), Error>

pub fn get_opacity(&self) -> Result<f32, Error>

pub fn set_opacity(&self, value: f32) -> Result<(), Error>

pub fn get_hover(&self) -> Result<bool, Error>

pub fn set_hover(&self, value: bool) -> Result<(), Error>

pub fn get_style(&self) -> Result<Option<Weak<Resource>>, Error>

pub fn set_style(&self, value: Option<&Resource>) -> Result<(), Error>

pub fn get_state_manager(&self) -> Result<Option<Weak<Resource>>, Error>

pub fn set_state_manager(&self, value: Option<&Resource>) -> Result<(), Error>

pub fn get_projection_2d_to_3d_scale(&self) -> Result<f32, Error>

pub fn set_projection_2d_to_3d_scale(&self, value: f32) -> Result<(), Error>

pub fn get_created_from_kzb(&self) -> Result<bool, Error>

pub fn set_created_from_kzb(&self, value: bool) -> Result<(), Error>

pub fn set_binding( &self, binding: &AbstractBinding, ) -> Result<AbstractBindingRuntime, Error>

Wrapper for setting a binding with no target. The binding has no target. You can use the binding to execute binding processors.

§Arguments
  • binding - Binding to set.
§Returns

Binding runtime handler created for the binding.

pub fn set_binding1<T>( &self, binding: &AbstractBinding, property_type: &PropertyType<T>, ) -> Result<AbstractBindingRuntime, Error>

Wrapper for setting a binding. Whole property is used. Local precedence is used.

§Arguments
  • binding - Binding to set.
  • property_type - Target property type.
§Returns

Binding runtime handler created for the binding.

pub fn set_binding2<T>( &self, binding: &AbstractBinding, property_type: &PropertyType<T>, property_field: PropertyField, ) -> Result<AbstractBindingRuntime, Error>

Wrapper for setting a binding. Local precedence is used.

§Arguments
  • binding - Binding to set.
  • property_type - Target property type.
  • field - Property field.
§Returns

Binding runtime handler created for the binding.

pub fn set_binding_with_owner<T>( &self, binding: &AbstractBinding, owner_object: &Object, property_type: &PropertyType<T>, ) -> Result<AbstractBindingRuntime, Error>

Wrapper for setting a binding with owner.

§Arguments
  • binding - Binding to set.
  • owner - Owner shared pointer for the binding.
  • property_type - Target property type.
§Returns

Binding runtime handler created for the binding.

pub fn set_binding_with_owner1<T>( &self, binding: &AbstractBinding, owner_object: &Object, property_type: &PropertyType<T>, property_field: PropertyField, ) -> Result<AbstractBindingRuntime, Error>

Wrapper for setting a binding with owner. Precedence of the value source binding is set to Local.

§Arguments
  • binding - Binding to set.
  • owner - Owner reference for the binding.
  • property_type - Target property type.
  • field - Property field.
§Returns

Binding runtime handler for the binding.

pub fn set_modifier_binding<T>( &self, binding: &AbstractBinding, property_type: &PropertyType<T>, ) -> Result<AbstractBindingRuntime, Error>

Wrapper for setting a modifier binding. As opposed to value source created by Self::set_binding, creates a property modifier binding. Whole property is used.

§Arguments
  • binding - Binding to set.
  • property_type - Target property type.
§Returns

Binding runtime handler created for the binding.

pub fn set_modifier_binding1<T>( &self, binding: &AbstractBinding, property_type: &PropertyType<T>, property_field: PropertyField, ) -> Result<AbstractBindingRuntime, Error>

Wrapper for setting a modifier binding. As opposed to value source created by Self::set_binding, creates a property modifier binding.

§Arguments
  • binding - Binding to set.
  • property_type - Target property type.
  • field - Property field.
§Returns

Binding runtime handler created for the binding.

pub fn set_modifier_binding_with_owner<T>( &self, binding: &AbstractBinding, owner_object: &Object, property_type: &PropertyType<T>, ) -> Result<AbstractBindingRuntime, Error>

Wrapper for setting a modifier binding. As opposed to value source created by Self::set_binding, creates a property modifier binding.

§Arguments
  • binding - Binding to set.
  • owner - Owner shared pointer for the binding.
  • property_type - Target property type.
§Returns

Binding runtime handler created for the binding.

pub fn set_modifier_binding_with_owner1<T>( &self, binding: &AbstractBinding, owner_object: &Object, property_type: &PropertyType<T>, property_field: PropertyField, ) -> Result<AbstractBindingRuntime, Error>

Wrapper for setting a modifier binding. As opposed to value source created by Self::set_binding, creates a property modifier binding.

§Arguments
  • binding - Binding to set.
  • owner - Owner shared pointer for the binding.
  • property_type - Target property type.
  • field - Property field.
§Returns

Binding runtime handler created for the binding.

pub fn remove_binding( &self, binding_runtime: &AbstractBindingRuntime, ) -> Result<(), Error>

Removes a binding runtime added earlier.

§Arguments
  • binding_runtime - Binding runtime to remove.

pub fn remove_bindings_with_owner( &self, owner_object: &Object, ) -> Result<(), Error>

Removes all binding runtimes with the specified owner.

§Arguments
  • owner - Owner of the binding runtime.

pub fn add_input_manipulator( &self, input_manipulator: &InputManipulator, ) -> Result<(), Error>

Transfers the ownership and attaches an input manipulator to an object node.

§Arguments
  • input_manipulator - The input manipulator to add.

pub fn remove_input_manipulator( &self, input_manipulator: &InputManipulator, ) -> Result<(), Error>

Removes the ownership and detaches an input manipulator from an object node.

§Arguments
  • input_manipulator - The input manipulator to remove.

pub fn get_resource_dictionary( &self, ) -> Result<Option<Weak<ResourceDictionary>>, Error>

If a node has a resource dictionary, returns the resource dictionary of that node.

§Returns

The resource dictionary of the node. If None is returned, the node does not have a resource dictionary.

pub fn acquire_resource_dictionary( &self, ) -> Result<Weak<ResourceDictionary>, Error>

Gets a resource dictionary of a node. If a resource dictionary does not exist, the function creates it.

§Returns

The resource dictionary of the node.

pub fn notify_resource_dictionary_modified(&self) -> Result<(), Error>

Forces the re-evaluation of resource IDs in a node tree. If you modify a resource dictionary of a node that is already attached, you can use this function to update the resource properties. Note that you need to use this function only if you modify the dictionary directly through Self::get_resource_dictionary or Self::acquire_resource_dictionary. If you use other Node class functions like Self::add_resource or Self::set_resource_dictionary, you do not need to call this function.

pub fn set_resource_dictionary( &self, resource_dictionary: &ResourceDictionary, ) -> Result<(), Error>

Replaces the resource dictionary of a node. Updates all the resource references of the child nodes.

§Arguments
  • resource_dictionary - The resource dictionary.

pub fn add_resource_dictionary( &self, resource_dictionary: &ResourceDictionary, ) -> Result<(), Error>

Adds a nested resource dictionary to the resource dictionary of a node. Updates all the resource references of the child nodes.

§Arguments
  • resource_dictionary - The nested resource dictionary.

pub fn is_named(&self, name: impl AsRef<KanziStr>) -> Result<bool, Error>

pub fn is_effectively_visible(&self) -> Result<bool, Error>

Returns whether a node and its ancestor nodes are visible.

pub fn is_effectively_focusable(&self) -> Result<bool, Error>

Returns whether a node is focusable. A node is focusable when it is a focus scope node or has FOCUSABLE_PROPERTY attached and set to true, or both.

pub fn is_initialized(&self) -> Result<bool, Error>

Returns true if initialize() has been called, false otherwise.

pub fn is_attached(&self) -> Result<bool, Error>

Returns true if the node is attached to a screen or one of its descendants.

pub fn is_attaching(&self) -> Result<bool, Error>

Returns true if node is in the process of attaching, false otherwise.

pub fn is_detaching(&self) -> Result<bool, Error>

Returns true if the node currently detaching.

pub unsafe fn attach_recursive(&self) -> Result<(), Error>

Attaches an object node and its children recursively.

§Safety

The caller must ensure that Self::detach_recursive is called before an object is destroyed.

pub unsafe fn detach_recursive(&self) -> Result<(), Error>

Detaches a node and its descendants.

§Safety

The caller must ensure that Self::attach_recursive was called on an object.

pub fn try_set_focus(&self) -> Result<Option<Weak<Node>>, Error>

Tries to move the focus to this node. If this node is a focus scope node, this method tries to focus the preserved focus of the focus scope, or tries to focus on the first focusable descendant node of this node. This is a convenience function of the FocusManager::trySetFocus(), that uses the node as target node.

§Returns

If this method successfully moved focus, returns this node or a descendant node of this node. If None is return, this method did not move focus.

pub fn lookup_node<T>( &self, name: impl AsRef<KanziStr>, ) -> Result<Option<Weak<T>>, Error>
where T: MetaInherits<Node>,

Returns a node of specified type by looking it up with specified path or alias. If None is returned, couldn’t find a node with a given name or node was found but of a different type

pub fn lookup_node_raw( &self, name: impl AsRef<KanziStr>, ) -> Result<Option<Weak<Node>>, Error>

Returns a node of specified type by looking it up with specified path or alias. If None is returned, couldn’t find a node with a given name.

pub fn lookup_object( &self, name: impl AsRef<KanziStr>, ) -> Result<Option<Weak<Object>>, Error>

Lookup for an object from a node. Object found may be another node or a resource within a node.

§Arguments
  • relativePath - Relative path to use for lookup.
§Returns

If None is returned, couldn’t find a node with a given name.

pub fn get_abstract_child_count(&self) -> Result<u64, Error>

pub fn add_abstract_child(&self, child: &Node) -> Result<bool, Error>

pub fn get_abstract_child_index(&self, child: &Node) -> Result<u64, Error>

pub fn get_abstract_child(&self, index: u64) -> Result<Weak<Node>, Error>

§Errors

Returns an INDEX_OUT_OF_BOUNDS error if the index is out of bounds.

pub unsafe fn get_abstract_child_unchecked( &self, index: u64, ) -> Result<Weak<Node>, Error>

§Safety

The caller must ensure that index < self.get_abstract_child_count().

pub fn remove_abstract_child(&self, child: &Node) -> Result<bool, Error>

pub fn get_parent(&self) -> Result<Option<Weak<Node>>, Error>

Returns the parent of the node.

pub fn add_message_handler<T>( &self, message_type: &MessageType<T>, closure: impl FnMut(T) -> Result<(), Error> + 'static, ) -> Result<MessageSubscriptionToken, Error>

Adds a message handler where the handler is a function. The handler is invoked when a message of messageType is signaled in the node the handler is added to.

pub fn add_message_handler_raw<T>( &self, message_type: &MessageType<T>, closure: impl Handler, ) -> Result<MessageSubscriptionToken, Error>

Adds a message handler where the handler is a function. The handler is invoked when a message of messageType is signaled in the node the handler is added to.

pub fn add_message_handler_from_source<T>( &self, message_type: &MessageType<T>, message_source_filter: &Object, closure: impl Handler, ) -> Result<MessageSubscriptionToken, Error>

Adds a message handler where the handler is a function and you explicitly define the accepted source. The handler is invoked when a message of messageType bubbles through the node to which you add the handler, but only when you dispatch it from the given source node.

pub fn add_message_filter<T>( &self, message_type: &MessageType<T>, closure: impl Handler, ) -> Result<MessageSubscriptionToken, Error>

Adds a message filter where the filter is a function. The filter is invoked when a message of messageType bubbles through the node the filter is added to.

pub fn add_tunneling_message_handler<T>( &self, message_type: &MessageType<T>, message_source_filter: &Object, closure: impl Handler, ) -> Result<MessageSubscriptionToken, Error>

Adds a message handler where the handler is a function and you explicitly define the accepted source. The handler is invoked when a message of messageType tunnels through the node to which you add the handler, but only when you dispatch it from the given source node.

pub fn add_tunneling_message_filter<T>( &self, message_type: &MessageType<T>, closure: impl Handler, ) -> Result<MessageSubscriptionToken, Error>

Adds a message filter where the filter is a function. The filter is invoked when a message of messageType tunnels through the node to which you add this filter.

pub fn remove_message_handler( &self, token: &MessageSubscriptionToken, ) -> Result<(), Error>

Removes a message subscription.

pub fn dispatch_message<T>( &self, message_type: &MessageType<T>, args: &T, ) -> Result<(), Error>

Dispatches a message from this node with specified arguments.

pub fn dispatch_message_raw<T>( &self, message_type: &MessageType<T>, args: &MessageArguments, ) -> Result<(), Error>

Dispatches a message from this node with specified arguments. No type verification is done

pub fn add_resource( &self, resource_id: &ResourceId, resource_url: impl AsRef<KanziStr>, ) -> Result<(), Error>

Adds a resource manager resource to an object node. If resource_id already exists in object, removes the existing entry.

pub fn remove_resource(&self, resource_id: &ResourceId) -> Result<(), Error>

Removes a resource with given ID from object node resource dictionary. Does not do anything if resource_id was not found.

pub fn contains_resource(&self, resource_id: &ResourceId) -> Result<bool, Error>

Returns if object node resource dictionary contains the resource with given ID. Resource can be any type: style, alias or resource manager resource.

pub fn find_resource_url( &self, resource_id: &ResourceId, ) -> Result<Option<KanziString>, Error>

Tries to find Resource URL for Resource ID from this node.

pub fn acquire_resource( &self, resource_id: &ResourceId, ) -> Result<Resource, Error>

Acquires a resource from the node or the node’s closest ancestor having the resource id in the resource dictionary.

§Arguments
  • resource_id - Name of the resource.

pub fn try_acquire_resource( &self, resource_id: &ResourceId, ) -> Result<Option<Resource>, Error>

Acquires a resource from the node or the node’s closest ancestor having the resource id in the resource dictionary.

§Arguments
  • resource_id - Name of the resource.

pub fn acquire_resource_async( &self, resource_id: &ResourceId, closure: impl AcquireFinishedCallback, ) -> Result<Option<ResourceAcquireTask>, Error>

Posts an asynchronous task to acquire a resource.

§Arguments
  • resource_id - Name of the resource.
  • closure - Callback to execute upon completion of the task.
§Returns

Task created or an None on failure.

pub fn add_anonymous_resource(&self, resource: &Resource) -> Result<(), Error>

Adds anonymous resource (such as style) for object node resources.

pub fn remove_anonymous_resource( &self, resource: &Resource, ) -> Result<(), Error>

Removes anonymous resource from object node resources.

pub fn add_node_component( &self, node_component: &NodeComponent, ) -> Result<(), Error>

Transfers the ownership of a node component to an object node.

pub fn add_node_component_with_owner( &self, node_component: &NodeComponent, owner: Option<&Object>, ) -> Result<(), Error>

Transfers the ownership of a node component to an object node and sets the owner of the node component.

pub fn remove_node_component( &self, node_component: &NodeComponent, ) -> Result<(), Error>

Removes the ownership of a node component from an object node.

pub fn remove_node_component_with_owner( &self, owner: Option<&Object>, ) -> Result<(), Error>

Removes all bindings with the specified owner.

pub fn lookup_node_component( &self, name: impl AsRef<KanziStr>, ) -> Result<Option<Weak<NodeComponent>>, Error>

Returns a node component of specified type by looking it up with specified name. If name is not specified, then the first anonymous node component is returned.

pub fn get_node_component_iterator( &self, ) -> Result<NodeComponentIterator, Error>

Gets the node component iterator.

pub fn get_node_components(&self) -> Result<Vec<Weak<NodeComponent>>, Error>

Gets all node components.

pub fn get_change_flags(&self) -> Result<i32, Error>

Gets current change flags.

pub fn get_child_change_flags(&self) -> Result<i32, Error>

Gets current child change flags.

pub fn set_change_flag(&self, flag: i32) -> Result<(), Error>

Sets a change flag.

pub fn clear_change_flag(&self, flag: i32) -> Result<(), Error>

Clears a change flag.

Methods from Deref<Target = Object>§

pub fn as_ptr(&self) -> *mut ObjectWrapper

pub fn as_wrapper(&self) -> &ObjectWrapper

pub fn as_object(&self) -> &Object

Represents any type inheriting from Object as &Object. This is useful for comparisions when PartialEq traits failed to compare objects of different types.

let child = screen.get_child(0)?;
let parent = child.get_parent()?.into_error(ErrorKind::ObjectNotFound)?;
// assert_eq!(screen, parent); // <- Fails to compile!
assert_eq!(screen.as_object(), parent.as_object());

pub fn get_native(&self) -> Result<NonNull<c_void>, Error>

Gets a pointer to the backing C++ instance.

pub fn is_stale(&self) -> bool

Checks whether the weak reference has expired.

pub fn get_property<T>( &self, property_type: &PropertyType<T>, ) -> Result<<T as VariantConstraint>::RetArg, Error>

Returns the current value of a property disregarding modifiers.

Base value is affected by the following inputs where the highest entry in the list determines the base value:

  1. Local value set with setProperty or loaded from kzb
  2. Value set by a style affecting the property.
  3. Value defined by class metadata.

Modifiers are not applied, the highest-priority base value is returned.

If no inputs to the property value can be established the system returns the value default value from property type metadata.

§Arguments
  • property_type - The property type identifying the property to retrieve.
§Returns

The evaluated property value.

pub fn get_optional_property<T>( &self, property_type: &PropertyType<T>, ) -> Result<Option<<T as VariantConstraint>::RetArg>, Error>

Returns the current value of a property disregarding modifiers, but does not default to the value in property metadata if there are no inputs to the property value.

If there is no value sources, None is returned.

If no inputs to the property value can be established the system returns the value default value from property type metadata.

§Arguments
  • property_type - The property type identifying the property to retrieve.
§Returns

The evaluated property value.

pub fn set_property<T>( &self, property_type: &PropertyType<T>, value: <T as VariantConstraint>::DataArg<'_>, ) -> Result<(), Error>

Sets the local value of a property type.

pub fn has_value<T>( &self, property_type: &PropertyType<T>, ) -> Result<bool, Error>

Evaluates whether there are any inputs into the property value. Both value sources and modifiers are taken into account.

§Returns

Returns true if there are inputs into the property value, false otherwise.

pub fn remove_local_value<T>( &self, property_type: &PropertyType<T>, ) -> Result<(), Error>

Removes the local value associated with the property.

pub fn get_metaclass(&self) -> Result<Metaclass, Error>

Returns the metaclass of the dynamic type of the object.

pub fn get_domain(&self) -> Result<Domain, Error>

Returns the domain the object belongs to.

pub fn set_flag_keep_during_patching<T>( &self, property_type: &PropertyType<T>, ) -> Result<(), Error>

Sets the flag to indicate that the property was loaded from KZB.

pub fn debug_string(&self) -> Result<String, Error>

Builds a string representation of the object intended for debugging purposes.

Trait Implementations§

§

impl Clone for GridListBox3D

§

fn clone(&self) -> GridListBox3D

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl ConcreteObjectConstraint for GridListBox3D

§

fn create_instance( domain: &Domain, name: impl AsRef<KanziStr>, ) -> Result<Self, Error>

§

impl Debug for GridListBox3D

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Deref for GridListBox3D

§

type Target = Node3D

The resulting type after dereferencing.
§

fn deref(&self) -> &<GridListBox3D as Deref>::Target

Dereferences the value.
§

impl IGridListBoxConcept for GridListBox3D

§

fn get_direction(&self) -> Result<GridDirection, Error>

§

fn set_direction(&self, value: GridDirection) -> Result<(), Error>

§

fn get_cell_width(&self) -> Result<f32, Error>

§

fn set_cell_width(&self, value: f32) -> Result<(), Error>

§

fn get_cell_height(&self) -> Result<f32, Error>

§

fn set_cell_height(&self, value: f32) -> Result<(), Error>

§

fn get_item_area_begin(&self) -> Result<f32, Error>

§

fn set_item_area_begin(&self, value: f32) -> Result<(), Error>

§

fn get_item_area_end(&self) -> Result<f32, Error>

§

fn set_item_area_end(&self, value: f32) -> Result<(), Error>

§

fn get_grid_list_box_recognition_threshold(&self) -> Result<f32, Error>

§

fn set_grid_list_box_recognition_threshold( &self, value: f32, ) -> Result<(), Error>

§

fn get_grid_list_box_minimum_number_of_touches(&self) -> Result<i32, Error>

§

fn set_grid_list_box_minimum_number_of_touches( &self, value: i32, ) -> Result<(), Error>

§

fn get_grid_list_box_maximum_number_of_touches(&self) -> Result<i32, Error>

§

fn set_grid_list_box_maximum_number_of_touches( &self, value: i32, ) -> Result<(), Error>

§

fn get_grid_list_box_sensitivity(&self) -> Result<f32, Error>

§

fn set_grid_list_box_sensitivity(&self, value: f32) -> Result<(), Error>

§

fn get_grid_list_box_sliding_acceleration_coefficient( &self, ) -> Result<f32, Error>

§

fn set_grid_list_box_sliding_acceleration_coefficient( &self, value: f32, ) -> Result<(), Error>

§

fn get_grid_list_box_sliding_drag_coefficient(&self) -> Result<f32, Error>

§

fn set_grid_list_box_sliding_drag_coefficient( &self, value: f32, ) -> Result<(), Error>

§

fn get_grid_list_box_dragging_acceleration_coefficient( &self, ) -> Result<f32, Error>

§

fn set_grid_list_box_dragging_acceleration_coefficient( &self, value: f32, ) -> Result<(), Error>

§

fn get_grid_list_box_dragging_drag_coefficient(&self) -> Result<f32, Error>

§

fn set_grid_list_box_dragging_drag_coefficient( &self, value: f32, ) -> Result<(), Error>

§

fn get_grid_list_box_dragging_impulse_factor(&self) -> Result<f32, Error>

§

fn set_grid_list_box_dragging_impulse_factor( &self, value: f32, ) -> Result<(), Error>

§

fn get_grid_list_box_swipe_distance(&self) -> Result<f32, Error>

§

fn set_grid_list_box_swipe_distance(&self, value: f32) -> Result<(), Error>

§

fn get_calculated_offset(&self) -> Result<f32, Error>

§

fn set_calculated_offset(&self, value: f32) -> Result<(), Error>

§

fn get_scroll_position(&self) -> Result<Vector2, Error>

§

fn set_scroll_position(&self, value: Vector2) -> Result<(), Error>

§

fn get_scroll_target_position(&self) -> Result<Vector2, Error>

§

fn set_scroll_target_position(&self, value: Vector2) -> Result<(), Error>

§

fn get_scroll_speed(&self) -> Result<Vector2, Error>

§

fn set_scroll_speed(&self, value: Vector2) -> Result<(), Error>

§

fn get_scrolling(&self) -> Result<bool, Error>

§

fn set_scrolling(&self, value: bool) -> Result<(), Error>

§

fn get_reversed_scrolling(&self) -> Result<bool, Error>

§

fn set_reversed_scrolling(&self, value: bool) -> Result<(), Error>

§

impl IListBoxConcept for GridListBox3D

§

type Base = Node3D

§

fn add_content_item(&self, abstract_item: &Self::Base) -> Result<(), Error>

§

fn remove_content_item(&self, abstract_item: &Self::Base) -> Result<bool, Error>

§

fn remove_all_content_items(&self) -> Result<(), Error>

§

fn get_content_item_count(&self) -> Result<u64, Error>

§

fn get_content_item(&self, index: u64) -> Result<Weak<Self::Base>, Error>

Errors Read more
§

unsafe fn get_content_item_unchecked( &self, index: u64, ) -> Result<Weak<Self::Base>, Error>

Safety Read more
§

fn notify_item_added(&self, index: u64) -> Result<(), Error>

Errors Read more
§

fn notify_item_removed(&self, index: u64) -> Result<(), Error>

Errors Read more
§

fn notify_item_replaced(&self, index: u64) -> Result<(), Error>

Errors Read more
§

fn notify_item_count_changed(&self) -> Result<(), Error>

Invalidates layout if the item container is changed.
§

fn get_item_count(&self) -> Result<i32, Error>

§

fn set_item_count(&self, value: i32) -> Result<(), Error>

§

fn get_keep_alive_item_count(&self) -> Result<i32, Error>

§

fn set_keep_alive_item_count(&self, value: i32) -> Result<(), Error>

§

fn get_selected_item_index(&self) -> Result<i32, Error>

§

fn set_selected_item_index(&self, value: i32) -> Result<(), Error>

§

fn get_selection_behavior(&self) -> Result<SelectionBehavior, Error>

§

fn set_selection_behavior(&self, value: SelectionBehavior) -> Result<(), Error>

§

fn get_item_generator_type_name(&self) -> Result<KanziString, Error>

§

fn set_item_generator_type_name( &self, value: impl AsRef<KanziStr>, ) -> Result<(), Error>

§

fn get_item_container_generator_type_name(&self) -> Result<KanziString, Error>

§

fn set_item_container_generator_type_name( &self, value: impl AsRef<KanziStr>, ) -> Result<(), Error>

§

fn get_item_template(&self) -> Result<Option<Weak<Resource>>, Error>

§

fn set_item_template(&self, value: Option<&Resource>) -> Result<(), Error>

§

fn get_item_container_template(&self) -> Result<Option<Weak<Resource>>, Error>

§

fn set_item_container_template( &self, value: Option<&Resource>, ) -> Result<(), Error>

§

impl Inheritable for GridListBox3D

§

unsafe fn downcast_unchecked<T>(self) -> T
where T: Inherits<Self>,

Downcast the object to a more specific type. Read more
§

unsafe fn downcast_unchecked_ref<T>(&self) -> &T
where T: Inherits<Self>,

Downcast the object reference to a more specific type. Read more
§

impl Inherits<GridListBoxConcept> for GridListBox3D

§

fn upcast(self) -> Base

§

fn upcast_ref(&self) -> &Base

§

impl Inherits<ListBoxConcept> for GridListBox3D

§

fn upcast(self) -> Base

§

fn upcast_ref(&self) -> &Base

§

impl Inherits<ListBoxScrollingConcept> for GridListBox3D

§

fn upcast(self) -> Base

§

fn upcast_ref(&self) -> &Base

§

impl Inherits<Node> for GridListBox3D

§

fn upcast(self) -> Base

§

fn upcast_ref(&self) -> &Base

§

impl Inherits<Node3D> for GridListBox3D

§

fn upcast(self) -> Base

§

fn upcast_ref(&self) -> &Base

§

impl Inherits<Object> for GridListBox3D

§

fn upcast(self) -> Base

§

fn upcast_ref(&self) -> &Base

§

impl MetaclassConstraint for GridListBox3D

§

fn get_static_metaclass() -> &'static Metaclass

Gets metaclass associated with a given type.
§

impl ObjectConstraint for GridListBox3D

§

fn downcast<T>(self) -> Result<Option<T>, Error>
where T: MetaInherits<Self>,

Casts metaclass to a more specific type by value.
§

fn downcast_ref<T>(&self) -> Result<Option<&T>, Error>
where T: MetaInherits<Self>,

Casts metaclass to a more specific type by reference.
§

fn is_a<T>(&self) -> Result<bool, Error>
where T: MetaInherits<Self>,

Determines whether the class this metaclass describes derives from a class described by specified metaclass.
§

fn downgrade(self) -> Weak<Self>

§

fn downgrade_ref(&self) -> Weak<Self>

§

fn lock(self) -> ThreadObject<Self>

§

fn lock_ref(&self) -> ThreadObject<Self>

§

impl<T> PartialEq<T> for GridListBox3D

§

fn eq(&self, rhs: &T) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<T> PartialEq<Weak<T>> for GridListBox3D

§

fn eq(&self, rhs: &Weak<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Eq for GridListBox3D

§

impl IListBoxScrollingConcept for GridListBox3D

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AsAny for T
where T: 'static,

§

fn as_any(&self) -> &(dyn Any + 'static)

§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Inherits<T> for T

§

fn upcast(self) -> Base

§

fn upcast_ref(&self) -> &Base

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<Base, T> MetaInherits<Base> for T
where Base: ObjectConstraint, T: Inherits<Base> + ObjectConstraint,