Disable the scroll temporarily ,of a TvertScrollBox component in Delphi? - delphi

I am making an application for IOS and Android devices in Delphi Rad Studio XE10.1 Berlin, and I have a problem.
In a form, I have a TvertScrollbox, and within it, there is many components to display, and one of them is a Tlistview.
The problem is, when I make a scroll in the Tlistview, because there is more data that shows, also makes a scroll in the TvertScrollbox, which in the end is impossible to visualize the data correctly.
Is there any way to disable the scroll of the TvertScrollbox temporarily, and then enable again?
I hope I have explained well. My English is very bad, Thank you.

Yes you can disable the TvertScrollbox by simply putting AniCalculations.TouchTracking := [] and then put it back to AniCalculations.TouchTracking := [ttVertical]
I made a TvertscollBox that implement all of this kind of behavior (deactivate the scroll when child object are scrolling), and that also correct some other bug ... the source code is too big to copy past here, so you can see it directly here :
(svn) https://svn.code.sf.net/p/alcinoe/code/
look the unit ALFmxLayouts
if you want to see a demo of the scroll deactivation look the project /demos/alfmxControls/ or load directly
https://sourceforge.net/p/alcinoe/code/HEAD/tree/demos/ALFmxControls/Android/Release/ALFmxControls/bin/ALFmxControls.apk?format=raw or the shorten variant if you need to write it manually in android: http:// tinyurl .com/zsamrbn (url of the compiled apk to install on android)
in the demo you can see a tabcontrol, when you scroll on it, the scroll of the vertscrollbox is deactivated

Related

10.4 IDE Cuts Off Component Toolbar

I downloaded latest Delphi IDE (10.4) and installed it. I turned off the embedded designer and set the layout to Classic Undocked.
Now the toolbar, in fact everything in the top form, is cut off. Can't see the save icons, run button or anything else. Also can't expand the form to make it taller.
If I change to startup layout it will let me expand the form, but I prefer Classic Undocked. Has anyone else had this yet and, more importantly, does anyone know a workaround?
I stumbled on a workaround for this problem. Here are the steps that makes the entire tool panel visible for me in Classic Undocked mode for Delphi 10.4 Sydney (on Win 7):
Grab the right edge of the top form (Classic Toolbar) and resize it slightly (make sure it is in Resizeable mode, not Full Screen). Zap! now everything works. Not only that, it appears to remember the "lesson" permanently once this has been done once - it is a complete and permanent fix.
This bug should be trivial for Embarcadero to fix.

Firemonkey with Memo Classes and Landscape orientation for Android

There are many demonstration units provided by both Embarcadero and other third parties for auto-scrolling on showing the Android virtual keyboard.
However non work correctly when working in landscape mode. Even if you manage to get the top of the memo visible, changing line will render the control out of sight, or you try and stay with the caret position and find the offset is wrong, manually correcting this causes issues with different resolutions.
Is there any article / component / code example, that anyone has seen, which solves this problem. I would opine that something so simple should be already resolved in the examples with RAD Studio, but alas it is not.
I am using native controls but am more than happy to switch back to Firemonkey styled controls if required.
Thank you in advance.

Delphi - Activating the Hint from another control of Application

I'm trying to activate Hint from control of different application created from delphi upon focus, I'm using hook to identify the focused control, and then use WM_MOUSEMOVE, which I think will activate the Hint of that control, the handle would be the Control itself and the lParam is the Left and Top of the Control. The Control activate the OnMouseMove Event, but the Hint never shows. but when I use SetCursorPos, Hint show, but I need to show the Hint with out the cursor move on that Control. Can you please help me with this? Thank you in advance... by the way I'm using Delphi XE4
Among the really asked question is how to show the hint of a control that resides on another application (i am afraid without hook that application can not be done), the title is "Delphi - Activating the Hint from another control of Application".
First is first: That can be done without knowing what language the other app was done, but it is very complex to put it here (and i am not an expert on such way of coding, also i hate apps that work that way).
Second: The main idea is to hook the other application, search on Google some code of that apps, that can show you a rectangular hole square of the object the mouse is passing over, that application while doing it is iconized (i do not remember the name of it).
Waht such app does: As you move the mouse over the screen it overlays a rectangular over the control that mouse is over, then if you press the key to print screen, that small region is the only thing that goes to clipboard; on of such apps i saw had an extra funcion, they can move such controls if you press cursors on keyboard, also can hide/enable/disable such control... more, it can also make controls that are invisible to be visible, etc... i saw it working on my computer, and hey, for fun it is pretty and to DeBug or get extra things on some apps is also great (make some menĂºs to be visible and enabled and then can use such funtions).
Please, please, understand i am agaist piracy and also against using such apps to let code to be run... some apps need pay for letting some menus enabled, but they have the code there, no need to change EXE to have/use that menus; just using this kind of apps makes that limited apps to be unlimited (just enable or show hidden menus and voila).
Note: To unhide menus, mouse point is not needed to be over the app, can be anywhere and is not moved.
The idea i want to say is: Any app can move, alter any control on any other app (at least on Windows) that is running, so maybe there can be a way to show such hint.
In the past i had use such app (sorry i do not remember the name) for DeBug my own apps, so i do not need to recompile in such cases where something was wrongly hidden, also work with buttons, labels, texts, combos, memos, etc.
Now my small problem is: I just need exactly what title say, but i can not make it to work.
Must be:
Mouse position must be irrelevant (it also must be able to be outside the application)
Just when a button that has focus is pressed with keyboard (Space or Enter) or just after some code somewhere on my application, i want to show the Hint of a specific TEdit for a short period of time.
I did not get Hint to be shown; not unless mouse point is over such TEdit but i want/need mouse pointer to not be over it, neither it to jump to the TEdit.
Idea Conept for that Hint to be shown: After doing some code that changes something, show extra info associated.
Example:
A button with that loads a file using an open dialog, filename is put on a ReadOnly TEdit (so it let user copy the text, but not change it); i want extra info that i punt on .Hint of such TEdit to be shown inmediatly.
That hint use is for not overload window with a lot of fields (TLabels) for showing such file data.
Simple idea: such Hint shows TimeStamp and size of the selected file.
P.D.: Not much related (since i am trying with a normal plain text hint), but hints can also store a full HTML page and with 3rd party tools be shown as an HTMLhint, so they can show a lot info of that file (also its content, etc) in a web based format; as i say i first try with standard plain text hints.
In order to show hint programatically you need to call TApplications ActivateHint method to which you specify the position parameter.
http://docwiki.embarcadero.com/Libraries/XE3/en/Vcl.Forms.TApplication.ActivateHint
Based on position parameter Application automatically finds which controll is at that position and shows its hint.
NOTE: Position parameter screen coordinates in pixels and not your controll coordinates. So you will have to use ClientToScreen method to change your coordinates apropriately.
You can see simple example of how to use this here: https://stackoverflow.com/a/15031208/3636228
Now if you need to do this from another application then you will have to add some comunication mechanizm to these two application so that one could send a proper message to tell the other to show the hint at specific position. But this does require you to be able to change both applications.
EDIT: This works with VCL applications but I'm not sure if it would work with FireMonkey applications.

Scrolling like Google Chrome with a click of the mouse wheel button

In Google Chrome when you click the mouse wheel button you get this cursor:
And then you are able to scroll to all possible directions, when you move around with your mouse...
IE also has this, but only moves up and down:
Is there any component for Delphi that can do this? (for a TScrollBox for example)
TMemo, for example, can do that for you, provided you set its ScrollBars property to something else than ssNone. It will even adjust according to which scroll bars are enabled. Problem with TScrollBar component is that on its own it doesn't have any focusable parts and won't receive OnMouseWheel(/Up/Down) events, but its included windowed controls might. You could write a workaround for that on main form events, though. Check solutions at http://www.delphipages.com/forum/showthread.php?t=197309
EDIT: OnMouseWheel(/Up/Down) should be OnMouse(/Up/Down), thanks to #Sertac Akyuz for pointing this out ;)
Seems like this feature is available in RAD studio 2009 (but not in D7).
You need to use Imouse (imouse.pas unit) and the control must have ControlStyle of csPannable.
quote:
Imouse (imouse.pas unit) is a standard implementation of scrolling
with middle button (called also "mouse panning"). It's also used in
RAD Studio. Imouse functionality relays on standard window scrollbars
and sends WM_HSCROLL/WM_VSCROLL to the window to make it scroll. It
works on every window, that have a scrollbar (e.g. TListView,
TTreeView, even TForm/TFrame if AutoScroll is True and at least one
scrollbar is visible).
Oh, I've forgotten one thing. Control must have csPannable in
ControlStyle, but RichView hasn't by default. So, after adding Code:
RichViewEdit1.ControlStyle := RichViewEdit1.ControlStyle +
[csPannable];
I didn't test it though.
All that is left for me is to look into the source code (When I can get my hands on copy of D2009) and maybe impliment this with D7...

Dynamic Splitter Panes

How would I go about implementing dynamic/docking splitter panes in a vb.net app similar to visual studio?
Check out the following demo at ZettaCube, their WebDock component seems to have functionalities close to VS.NET, especially docking and auto-hide.
http://www.zettacube.com/
DockPanel is one painless & open source way to do it.
DockPanel is for WinForms only. Seems that the WebDock from zettacube above is the only solution for now.
Not easily is the short answer.
A high level idea would be to define some regions using divs or a table and using your js framework of choice make these elements resizeable. that gets you the splitter aspect.
The docking will have to use absoluting positioned elements that you can drag and drop and if you are currently over a docking element, reposition the element to be docked to inside the docking element and change it's position back to normal. When you want to drag it out you will change it's positioning back to absolute
Also, this is not easy to do and will take a long time and still probably not work correctly. Sorry to sound pessimistic though.
I would say use some of the already available controls out there.
I use the control library from Janus Controls, but there are dozens out there to choose from.
http://www.janusys.com/controls/
Agree with Nick, this is not something you just throw together yourself.

Resources