pub trait GuiVComponentMethods<T: GuiComponentMethods = Self>: GuiComponentMethods<T> {
Show 20 methods // Provided methods fn set_focus(&self) -> Result<()> { ... } fn visualize(&self, on: bool) -> Result<()> { ... } fn acc_text(&self) -> Result<String> { ... } fn acc_text_on_request(&self) -> Result<String> { ... } fn acc_tooltip(&self) -> Result<String> { ... } fn changeable(&self) -> Result<bool> { ... } fn default_tooltip(&self) -> Result<String> { ... } fn height(&self) -> Result<i64> { ... } fn icon_name(&self) -> Result<String> { ... } fn is_symbol_font(&self) -> Result<bool> { ... } fn left(&self) -> Result<i64> { ... } fn modified(&self) -> Result<bool> { ... } fn parent_frame(&self) -> Result<GuiComponent> { ... } fn screen_left(&self) -> Result<i64> { ... } fn screen_top(&self) -> Result<i64> { ... } fn text(&self) -> Result<String> { ... } fn set_text<S>(&self, value: S) -> Result<()> where S: AsRef<str> { ... } fn tooltip(&self) -> Result<String> { ... } fn top(&self) -> Result<i64> { ... } fn width(&self) -> Result<i64> { ... }
}
Expand description

The GuiVComponent interface is exposed by all visual objects, such as windows, buttons or text fields. Like GuiComponent, it is an abstract interface. Any object supporting the GuiVComponent interface also exposes the GuiComponent interface. GuiVComponent extends the GuiComponent Object.

Provided Methods§

source

fn set_focus(&self) -> Result<()>

This function can be used to set the focus onto an object. If a user interacts with SAP GUI, it moves the focus whenever the interaction is with a new object. Interacting with an object through the scripting component does not change the focus. There are some cases in which the SAP application explicitly checks for the focus and behaves differently depending on the focused object.

source

fn visualize(&self, on: bool) -> Result<()>

Calling this method of a component will display a red frame around the specified component if the parameter on is true. The frame will be removed if on is false. Some components such as GuiCtrlGridView support displaying the frame around inner objects, such as cells. The format of the innerObject string is the same as for the dumpState method.

source

fn acc_text(&self) -> Result<String>

An additional text for accessibility support.

source

fn acc_text_on_request(&self) -> Result<String>

An additional text for accessibility support.

source

fn acc_tooltip(&self) -> Result<String>

An additional tooltip text for accessibility support.

source

fn changeable(&self) -> Result<bool>

An object is changeable if it is neither disabled nor read-only.

source

fn default_tooltip(&self) -> Result<String>

Tooltip text generated from the short text defined in the data dictionary for the given screen element type.

source

fn height(&self) -> Result<i64>

Height of the component in pixels.

source

fn icon_name(&self) -> Result<String>

If the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

source

fn is_symbol_font(&self) -> Result<bool>

The property is TRUE if the component’s text is visualized in the SAP symbol font.

source

fn left(&self) -> Result<i64>

Left position of the element in screen coordinates

source

fn modified(&self) -> Result<bool>

An object is modified if its state has been changed by the user and this change has not yet been sent to the SAP system.

source

fn parent_frame(&self) -> Result<GuiComponent>

If the control is hosted by the Frame object, the value of the property is this frame. Overwise NULL.

source

fn screen_left(&self) -> Result<i64>

The y position of the component in screen coordinates.

source

fn screen_top(&self) -> Result<i64>

The x position of the component in screen coordinates.

source

fn text(&self) -> Result<String>

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you can’t change it, whereas you can only set the text property of a password field, but not read it.

source

fn set_text<S>(&self, value: S) -> Result<()>where S: AsRef<str>,

The value of this property very much depends on the type of the object on which it is called. This is obvious for text fields or menu items. On the other hand this property is empty for toolbar buttons and is the class id for shells. You can read the text property of a label, but you can’t change it, whereas you can only set the text property of a password field, but not read it.

Examples found in repository?
examples/simple.rs (line 48)
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
fn main() -> Result<()> {
    // Initialise the environment.
    let com_instance = SAPComInstance::new()?;
    eprintln!("Got COM instance");
    let wrapper = com_instance.sap_wrapper()?;
    eprintln!("Got wrapper");
    let engine = wrapper.scripting_engine()?;
    eprintln!("Got scripting engine");
    let connection = engine.get_connection(0)?;
    eprintln!("Got connection");
    let session = connection.children(0)?;
    eprintln!("Got session");
    if let SAPComponent::GuiMainWindow(wnd) = session.find_by_id("wnd[0]")? {
        wnd.maximize().unwrap();

        if let SAPComponent::GuiOkCodeField(tbox_comp) =
            session.find_by_id("wnd[0]/tbar[0]/okcd")?
        {
            tbox_comp.set_text("/nfpl9").unwrap();
            wnd.send_vkey(0).unwrap();
        } else {
            panic!("no ok code field!");
        }
    } else {
        panic!("no window!");
    }

    Ok(())
}
source

fn tooltip(&self) -> Result<String>

The tooltip contains a text which is designed to help a user understand the meaning of a given text field or button.

source

fn top(&self) -> Result<i64>

Top coordinate of the element in screen coordinates.

source

fn width(&self) -> Result<i64>

Width of the component in pixels.

Implementors§