RADAsyncUpload goes beyond the container - telerik

In the Demo of RadAsyncUpload at https://demos.telerik.com/aspnet-ajax/asyncupload/examples/overview/defaultcs.aspx, on inspecting the select button, the input of type "file" goes beyond the container. How can I make it stay within the boundary of the select button?

You can apply Width and Height to the .ruFileInput class override as shown in the screenshot I captured for you:

Related

How can I determine what part of text in a scroll view is visible on screen from an Xcode UI test?

I'm new to the Xcode User Interface testing framework. I can successfully manipulate the screen elements, but cannot work out how to produce a meaningful assertion about what text is visible in a scrolling view.
The test I would like to write would go as follows: launch the app, type lots of text into a text view (enough that the first line scrolls out of view), assert that the first line of text is not visible, scroll the view back up to the top, then assert that the first line is now visible. Note that the purpose of this test is to ensure my app has wired things up correctly, not to test Apple's code.
XCUIApplication allows me to type into my NSTextView instance, and also allows me to scroll the associated NSScrollView. But how do I assert whether the first line of text is currently visible? The value attribute on XCUIElement provides the entire text content of the view, whether or not it is currently displayed.
The accessibilityRange(forLine:) and accessibilityString(for:) methods on NSTextView would be ideal, but I can't see how to access them as the UI test only has access to an XCUIElement, not the underlying NSTextView.
Have I missed something, or is there a better way to approach this?
If you set the accessibility identifier in the storyboard or in code for the text view you can get the text view via (assuming you gave it the id "textview1" and the window it's in has the default accessibility identifier of "Window"):
let textview1TextView = app.windows["Window"].textViews["textview1"]
but that won't actually get you what you need.
Instead, set the accessibility identifier of the scrollview and get that:
let scrollview = app.windows["Window"].scrollViews["scrollview1"]
Then use that to get the scrollbars (you should only have one in this case; you can use scrollbars.count to check.
let scrollbars = scrollview.scrollBars
print("scrollbars count: \(scrollbars.count)")
Then you can use the value attribute of the scrollbar to get it's value:
(you're converting a XCUIElemenTypeQueryProvider into an XCUIElement so you can get it's value):
let val = scrollbars.element.value
it will be 0 at the top and a floating point value when scrolled (one line of text in my test code showed a value of {{0.02409638554216868}}.
Documentation that will help you explore further:
XCUIElementTypeQueryProvider
XCUIElementAttributes
Note that you can put a breakpoint in the middle of your test, run it and then use the debugger console to examine things:
(lldb) po scrollbars.element.value
t = 749.66s Find the ScrollBar ▿ Optional<Any>
- some : 0
(lldb) po scrollbars.element.value
t = 758.17s Find the ScrollBar ▿ Optional<Any>
- some : 0.05421686746987952
and while in the debugger you can even interact with your app's window to scroll it manually (which is what I did between typing in those two po calls), or perhaps add text and so on.
OK OP now noted that they're interested in the specific text showing or not rather than the first line in view or not (which is what I previously answered above).
Here's a bit of a hack, but I think it'll work:
Use XCUICoordinate's click(forDuration:, thenDragTo:) method to select the first line of text (use the view frame to calculate coordinates) and then use the typeKey( modifierFlags:) to invoke the edit menu "copy" command. Then use NSPasteboard methods to get the pasteboard contents and check the text.
Here's a quick test I did to validate the approach (selecting the first line of text using XCUICoordinate as noted above is left as an exercise for the reader):
NSPasteboard.general.clearContents()
// stopped at break point on next line and I manually selected the text of the first line of text in my test app and then hit continue in the debugger
textview1TextView.typeKey("c", modifierFlags:.command)
print( NSPasteboard.general.pasteboardItems?.first?.string(forType: NSPasteboard.PasteboardType.string) ?? "none" );
-> "the text of the first line" was printed to the console.
Note that you can scroll the selection off screen so you have to not scroll after doing the select or you won't be getting the answer you want.

How to scroll to a particular co-ordinate in Test Complete

I have spied a notepad and text box of a notepad contains a string which will be visible only if you scroll down.
Now I am trying to perform a single click there via passing a rectangle co-ordinate to the Test Complete.So with that it is able to click if it is visible on the screen otherwise it fails saying :"there was an attempt to perform an action at a point which is beyond the screen"
Is there any way where we can scroll to the point of interaction before performing the action.
I tried with following steps to achieve that but its of no help.
testObj.setFocus()
testObj.hover()
testObject.MouseWheelScroll(an integer value)
Please try this..
testObj.scrollIntoView(true);
I'm using this code and this is working fine for me..

How can I measure the width of the caption bar available for text?

I'm trying to adjust the caption of my main window to show as much of a file name as is possible to fit in the caption area. So, I'm looking to calculate the width of the area marked up here in the red rectangle:
Now, I would ideally like to have code that can use whatever system metrics are available and thereby avoid being caught out by all the various platform/theme/dpi variations that can exist.
How can this be done, if indeed it is even possible?
As andlabs said in the comments, the WM_GETTITLEBARINFOEX message can be used to obtain the required information.
This message can be sent to the window and the TITLEBARINFOEX struct is populated with the state and location of the titlebar and each of its buttons. From there it is a simple task to determine how much space is available for the caption.
First, call GetTitleBarInfo, passing a pointer to the TITLEBARINFO structure:
TITLEBARINFO tbi;
GetTitleBarInfo(hwnd, &tbi);
The width of the titlebar is tbi.rcTitlebar.right - tbi.rcTitlebar.left. But that includes the three buttons (Close, Minimize, and Maximize). The width of one button is GetSystemMetrics(SM_CXSIZE), so the width of the title bar minus the three buttons is
(tbi.rcTitlebar.right - tbi.rcTitlebar.left) - (3 * GetSystemMetrics(SM_CXSIZE))
Of course, the code works on all versions of Windows where the width of each of the 3 buttons is equal

How to show more/all of the info in the function parameter tooltip?

When you start filling out function parameters, a tooltip pops up showing the list of parameters the function is expecting, and optionally some description underneath if one is provided by adding comments above the function definition.
/**
* Some optional text with info about the function, etc.
*/
myFunction(param1, param2... ){};
My problem is that the description bit of the function I'm using doesn't fit inside the tooltip box.
http://oi62.tinypic.com/212a3dk.jpg
The pic shows what I mean.
It gets down to the bottom of the tooltip box and keeps going, beyond the visible rectangle boundaries. There are several more lines below where it cuts off at that I would like to be able to see.
How do I view the rest of the description inside the tooltip?
I was expecting some kind of scroll bar or something to resize the tooltip rectangle with.
Also is there a way to have the tooltip box always open, like have it as a dockable window that will show the parameter info of whatever I'm currently mousing over?

Simple Oracle Forms Menu

I wan't to have a simple menu (main menu not menu bar) whith buttons to link to another form(s)/window(s)/caveses(s). Or atleast the code to switch bettween the screen.
What code (SQL/PL) would I put in the buttons or is there a better way to do this?
That's a very broad question. If you want to show a specific window on WHEN-BUTTON-PRESSED then you can use built in like below-
SET_WINDOW_PROPERTY('WINDOW_NAME', VISIBLE, PROPERTY_TRUE); --This would display the window
SET_WINDOW_PROPERTY('WINDOW_NAME', VISIBLE, PROPERTY_FALSE); --This will hide the window
The above would work if you use the SET_WINDOW_PROPERTY within the same form.
In case you want to call another form from the parent form (which is the case as per your comment screenshot) you need to to use CALL_FORM built-in like
CALL_FORM('MEMBERS');
Why dont you just make 1 form only?1 form, many datablock,canvas, window
anyway, for your question, just call the block
go_block('your_block');
if you want to call another block
go_block('another_block');
hide_window('1st_open_window');
you should make 1 canvas in 1 window for better arrangement
You can also use Stack canvas within the same form which gets visible as you click on the button.
SHOW_VIEW('CANVAS_NAME');
And in that stack you can do whatever you want.

Resources