Scrolling in iphone and android devices in LiveCode - livecode

I am working on a livecode application for Android, iPhone, Windows. I would like to add a scroller to a group. So I set vertical scroller of group to true and it worked with a vertical scroll bar on the right nicely for Windows. But when testing it for Android there still a vertical bar for scrolling, I was assuming it may automatically work like a fundamental scroller as it comes with android.
I would like to add a touch scroller instead of a vertical scroller for Android and Iphone. How i can do that?

This lesson explains how to create a native scroller for a text field. However, this method can be implemented on any group-
http://lessons.runrev.com/s/lessons/m/4069/l/94412-creating-a-native-scroller-to-scroll-a-field

With my apologies to the original author, for the lack of attribution, here is some script that will allow scrolling of groups on both desktop and mobile platforms, and does not use the native iOS or Android scrolling "overlays":
local allowMove
on mouseDown
put mouseH(),mouseV() into allowMove
end mouseDown
on mouseMove X,Y
if allowMove is not empty then
lock screen
if the hScrollbar of me then
set the hScroll of me to the hScroll of me + (item 1 of allowMove-X)
end if
if the vScrollbar of me then
set the vScroll of me to the vScroll of me + (item 2 of allowMove-Y)
end if
put X into item 1 of allowMove
put Y into item 2 of allowMove
unlock screen
end if
end mouseMove
on mouseUp
put empty into allowMove
end mouseUp
on mouseRelease
mouseUp
end mouseRelease
The original script has been modified slightly by me to allow scrolling only if the corresponding scrollbars are visible. This makes it very quick and easy to enable or disable scrolling in different directions. I use this for prototyping.

Related

How to snap a window to top/bottom half of screen

One of my favorite features in Windows is the ability to snap windows. [1]
With Windows 10 they can now be snapped to quarter-screen, as well as the left- and right-half screen available in previous Windows releases.
Is it possible to snap a window to top and bottom half?
In other words, snap a window to span the width of the monitor, but only half the height? It could be snapped to either the top or bottom of the screen.
https://support.microsoft.com/en-us/help/4027324/windows-10-snap-your-windows
Unfortunately no, not natively. See e.g.: https://answers.microsoft.com/en-us/windows/forum/windows_10-desktop-winpc/snap-assist-to-top-and-bottom-in-portrait-mode/3ecdd25e-8886-4ef1-a7db-0d2e168ce381.
There are third-party solutions, such as https://www.displayfusion.com/Discussions/View/portrait-mode-and-windows-snapping/?ID=8e0ff0b8-5988-43d9-bd54-4567d7869f48 and https://www.nurgo-software.com/products/aquasnap
This is now natively supported in Windows 11. Press Windows+Z, then you can select where you want your window to be. There are several other portrait-only layouts too (the spot that is dark blue is the one my mouse is hovering over):
Not in the way that you snap windows to the left and right; if you try to snap a window to the top by dragging it to the top of your screen it will just maximize that window...and dragging to the bottom won't work at all.
One way that I can think of that will work is minimize 2 windows that you want to split and resize them both so that they span the width of the screen and approximately half the height of the screen. Then drag each window to the desired portion of the screen. To make things easier, you might want to have the window that you want on the bottom of the screen open over the one that you want on top of the screen before you start minimizing windows.

how to widen the Visual Studio Code's Terminal window from left end of screen to right end of screen?

In Visual Studio Code, Terminal window is some inconvenient because of the width.
I want to widen the width from the end of screen to the end of screen.
Is it possible?
enter image description here
As far as I'm aware, no, this isn't possible to some extent, but perhaps there are some extensions you could search around to see if they can do something similar.
Remember that using your PC's command terminal is also an option.
However, I've found that minimizing the left sidebar by dragging it to the left is an option, which increases the terminal width to the entire screen if this is what you're looking for:
Note doing that disables you from accessing that entire sidebar unless you drag it out again.

How to properly display a focus rectangle in a compact SplitView menu item

I'm building my first Universal Windows Platform (UWP) App and am trying to implement the popular "Hamburger Menu" using the SplitView class.
Inspired by many samples, the items hosted on the SplitView pane are re-styled RadioButton controls, with a vertical highlight-rectangle, an icon and a text. The appearance is similar to that of the Groove app.
I'm now trying to implement navigation and selection using the keyboard, and this now bring a little focus-rect around the items in the SplitView pane. However, since the pane clips its contents when its DisplayMode is either CompactInline or CompactOverlay, the focus rectangle is also clipped, which is not the behavior a user would expect.
Please, can anyone advise on how to property display the focus rectangle in this situation ?
Just an idea, what if you set the width of all radio button's to be same as the CompactPaneLength property of SplitView. The default is 48 DIPs.

How to create a mouseover effect on buttons in livecode?

I've been looking for a mouseover effect in LiveCode but I haven't got it yet.
I would like to get an effect somewhat like this link:
Creating a Mouseover Fade Effect with jQuery
This was created in jQuery. Can it be applied in LiveCode?
mouseEnter (followed by mouseLeave) is pretty much the equivalent of mouseover in web technologies. LiveCode doesn't have a built-in fade effect, but you can write your own by changing the blendLevel property of an object. For example, add the following script to a button to make it fade out to 80% translucency on mouseEnter (mouseover), and fade back to opaque on mouseLeave:
on mouseEnter
repeat with N = 0 to 80 step 5
set blendLevel of me to N
end repeat
end mouseEnter
on mouseLeave
repeat with N = 80 to 0 step -5
set blendLevel of me to N
end repeat
end mouseLeave
If you don't need the fade-in/out you can accomplish the rollover effect without scripting. Simply import the two images, then set the icon property of a button to the id of one image and the hoverIcon property of the same button to id of the other image.
In terms of scripting rollover effects, Scott's answer is spot-on—you can use the mouseEnter and mouseLeave messages to create whatever visual change you want. If you need the fade-in/out effect this will do it:
-Create a new button, make it transparent, showName off, borders off.
-Import your two images. Let's say they are named image1 and image2.
-Set the script of the button to the following:
on mouseEnter
set the effectRate to 500
lock screen for visual effect
set the icon of me to "image2"
unlock screen with visual effect dissolve
end mouseEnter
on mouseLeave
set the effectRate to 500
lock screen for visual effect
set the icon of me to "image1"
unlock screen with visual effect dissolve
end mouseLeave
This creates an effect almost precisely like the one in the link you provided. You can change the rate of the dissolve effect by changing the effectRate; higher rate for slower dissolve, lower rate for faster dissolve. (The effectRate is in milliseconds.)
on mousewithin
put random(1000)
end mousewithin

Can I use an image instead of a title in an Apple Watch app?

How can I put an icon in the top left label and make fullscreen? Apple allocates some space on top for the digital clock and back label. I would like to customize it, but I can't find anything in the SDK to enable this.
The top strip of the Watch screen is reserved for displaying the page title, or occasionally links such as "Cancel" by default for modal views, and the clock. It is not possible to hide this.
It is possible to set an empty title for a page. Some settings will alsoplace a background image behind this text (if you set the mode to 'Aspect Fill', at least in the current Xcode 6.2 beta 3). However, the portion of the image at the top of the screen is simply occluded by a black strip, so this does not achieve what you want.
Additionally, Apple have specifically recommended against displaying logos on the Apple Watch screen, with the rationale that the screen is too small to display for the user anything but actual content.
To set the Global tint:
Select the Interface Controller itself in Interface Builder by clicking on the Yellow circle at the top of the view of the screen.
Press Cmd-Opt-1 to display the File Inspector section of the Utilites on the right hand side.
Set the 'Global Tint' option in the section 'Interface Builder Document', as per the screenshot.
Not possible in the first cut but I think it will come later.
It's not actually a back label. The text in the top left of the Watch screen is the title of the current WKInterfaceController. You can change it by using -[WKInterfaceTitle setTitle:], but you are limited to content that is expressible in an NSString (so no UIImages).
It is possible to customise the status bar in watchOS 4.
Select your interface controller in the storyboard
Open the attributes inspector
Check the Full Screen checkbox
After doing this you can add your custom image to the left of the statusbar.

Resources