Home
Top.Mail.Ru Yandeks.Metrika
Forum: "Beginners";
Current archive: 2010.08.27;
Download: [xml.tar.bz2];

Down

Transition by arrows between windows Find similar branches


Light-blr   (2010-05-07 01:59) [0]

Help me please. On the form there are n windows located one below the other. It is necessary to move up the arrow to the window located above the current one, well, and down, respectively.

Trying to catch a message, nothing comes out of me.
.
type
TForm1 = class (TForm)
Shape1: TShape;
Edit1: TEdit;
Shape2: TShape;
Edit2: TEdit;
procedure Edit1Enter (Sender: TObject);
procedure Edit1Exit (Sender: TObject);
procedure FormCreate (Sender: TObject);
procedure FormShow (Sender: TObject);
procedure WMKeyUp (var Msg: TWMKeyUp); message WM_KeyUp;
.
procedure TForm1.WMKeyUp (var Msg: TWMKeyUp);
begin
if Msg.CharCode = vk_Up then
if Order [tp, 3] <> 0 then tp: = Order [tp, 3];
Comp: = FindComponent (Names [tp]);
(Comp as TEdit) .SetFocus;
inherited;
end;
in the Order array, I have indexes for the names of the windows above / below / to the right / left of the current one.

So, I don’t get into this function in any way, although there is a breakpoint there. That is, she does not catch anything and, accordingly, the transition between the windows along the arrows does not occur.

Please help me deal with this situation.



Leonid Troyanovsky ©   (2010-05-07 07:44) [1]


> Light-blr (07.05.10/01/59 XNUMX:XNUMX p.m.)

> Help, please. There are n windows on the form,

If the "window" is Edit (n = 2), then for moving between them,
like other controllers, Tab & Shift + Tab is designed.

The form handler does not work because the message
processed by control in focus.

It is also helpful to remember what was said by Peter Below:
http://groups.google.com/group/fido7.ru.delphi.chainik/msg/9882c0fd38c38706

--
Regards, LVT.



Mike Kouzmine   (2010-05-07 07:53) [2]

use the standard mechanism
either manage selectnomext yourself, or replace key up down with a tab or shift tab



Light-blr   (2010-05-07 09:06) [3]

Thank you, I know about tab and shift tab. The problem is that I need to switch from the window in 4 directions (up-down-right-left), and the tab assumes a linear order, i.e. only 2 sides.

Leonid Troyanovsky
Thanks, read. I realized that I needed to replace WM_KeyUp (or WM_KeyDown) with CM_CHILDKEY, because the window tries to process the message itself, and WM_KeyDown does not work.



Плохиш ©   (2010-05-07 10:22) [4]


> if Order [tp, 3] <> 0 then tp: = Order [tp, 3];
> Comp: = FindComponent (Names [tp]);
> (Comp as TEdit) .SetFocus;
> inherited;
> end;
> in the Order array I have indexes of window names
> top / bottom / right / left of the current.
>

Throw this code along with the array.
Arrange TabOrder in the correct order and use to move:

     PostMessage(Handle, WM_NEXTDLGCTL, 1, 0);
     PostMessage(Handle, WM_NEXTDLGCTL, 0, 0);



Light-blr   (2010-05-07 22:15) [5]

And what is the correct order if I need to go in 4 directions? Well, it doesn’t work out linearly!

Now I was puzzled by the question of how, when pressing the arrow, to track the simultaneous pressing of the ctrl key, and only then switch between the windows. And then after all, in the window itself, you will want to move the cursor, but already.



Игорь Шевченко ©   (2010-05-07 22:59) [6]


> Now puzzled by the question of how to track the arrow
> ctrl key simultaneously


if GetKeyState (VK_CONTROL) <0 then
// control pressed



Light-blr   (2010-05-07 23:07) [7]

thanks! :) everything works like a clock.



Плохиш ©   (2010-05-08 02:38) [8]


> Light-blr (07.05.10/01/59 XNUMX:XNUMX p.m.)
>
> Help, please. On the form there are n windows located
> one below the other. Need to go up arrow
> to the window located above the current one, well, and "down", respectively.
>


> Light-blr (07.05.10/22/15 5:XNUMX p.m.) [XNUMX]
>
> And what order is correct if I need to go in 4 directions?
> Well, it doesn’t work out linearly!

A poor country, but in the madhouse they are looking for coders ...



Германн ©   (2010-05-08 02:42) [9]


> Bad © (08.05.10 02: 38) [8]


> Poor country, but in the madhouse of the coders are looking for ...

Andrew. Do not rush with such reproaches.
Or maybe it will be a new toy that will hit the whole world, like Tetris once!
:)



MsGuns ©   (2010-05-08 02:48) [10]

Laughter, laughter, but when there was such a problem, in the end I wrote a couple of functions that determine the "geometric" coordinates of the controls on the container and move the focus "where necessary" buttons
:)



Германн ©   (2010-05-08 02:54) [11]


> MsGuns © (08.05.10 02: 48) [10]
>
> Laughter, laughter, but when it was such a problem

And where is that toy? Give me the link.



Плохиш ©   (2010-05-08 02:56) [12]


> Hermann © (08.05.10 02: 42) [9]

Judging by the second paragraph of [5], I will not live to see a masterpiece.

> MsGuns © (08.05.10 02: 48) [10]

Well, judging by the details gradually creeping out from the next partisan, one can get by with a stringgrid.



Германн ©   (2010-05-08 03:08) [13]


> Bad © (08.05.10 02: 56) [12]
>
>
>> Hermann © (08.05.10 02: 42) [9]
>
> Judging by the second paragraph of [5], I will not live to see a masterpiece.

Do not drift, old man! Here we will survive / survive many.
:)



Anatoly Podgoretsky ©   (2010-05-08 10:36) [14]

> Bad (08.05.2010 02: 56: 12) [12]

Partizanen, no pasaran.



MsGuns ©   (2010-05-09 02:04) [15]

> Р “ермР° РЅРЅ В © (08.05.10 02: 54) [11]
> And where is that toy? Give me the link.

That’s Newton’s bin, you’ll strain yourself :)
and if without jokes, then at work all my little things - I haven’t been working at home for a long time



Германн ©   (2010-05-09 02:36) [16]


> MsGuns © (09.05.10 02: 04) [15]
>
>> Hermann © (08.05.10 02: 54) [11]
QuotedXNUMX>> And where is that toy? Give me the link.
>
> That’s Newton’s binom

Do I need it? Tense, that is? But if you said it, then answer for what has been said!

PS
For me, home has long been == work.



Andy BitOff ©   (2010-05-09 02:39) [17]

> MsGuns © (09.05.10 02: 04) [15]
> I haven’t been working at home for a long time

And I because I discovered Butfield =)))



Anatoly Podgoretsky ©   (2010-05-09 10:24) [18]

> Hermann (09.05.2010 02: 36: 16) [16]

You end this. Better take the dog out for a walk.



Германн ©   (2010-05-10 02:58) [19]


> Anatoly Podgoretsky © (09.05.10 10: 24) [18]
>
>> Germann (09.05.2010 02: 36: 16) [16]
>
> You're done with this. Better take the dog out for a walk.

Derived, damn it.
For the first time in many years, we went out for a walk with the whole family. Plus a friend of my wife and daughter.
As a result, everyone got wet and frozen. Plus, the chronicle of my foot escalated (due to the fact that it was wet in the cold rain). Plus, the chronicle of my hand escalated (due to the fact that I had to pull a dog that is terribly afraid of a thunderstorm).

But after the "after midnight", about an hour and a half work on the exclusive version of the gas analyzer, the chronicles are gone.
:)



Anatoly Podgoretsky ©   (2010-05-10 07:44) [20]

Well, not everyone helps, especially in the advanced case, it is necessary to repeat constantly.



Light-blr   (2010-05-15 23:22) [21]

> Bad © (08.05.10 02: 38) [8]

> Poor country, but in the madhouse of the coders are looking for ...

as they say, you will not be rude or rude.
She described it to a minimum, since in the case of the transition using the arrows between the two windows, it is not difficult to organize the same transition between all the others. but when offers “to pass by tabs and not to bathe” were showered, the task specified. Apparently, the Delphi masters are too lazy to read anything other than the first message.
I didn’t ask how it is possible to switch between windows, only a <not very smart person> can assume that a programmer does not know about tabs.
write, write your "great toys." I personally sculpt purely application programs personally for myself. I’m not trying to “drive” anyone, I do not intend to write something grandiose, guided by the answers to questions in a conference for beginners.
I didn’t think that so unpleasant types live here. I'm sorry that I interfered with my question into a continuous stream of "help, I can’t calculate the sum of ten numbers," to answer such questions, of course. masters, yeah ...



Плохиш ©   (2010-05-15 23:50) [22]

Too many beetles ..



Плохиш ©   (2010-05-15 23:55) [23]


> Light-blr (15.05.10/23/22 21:XNUMX p.m.) [XNUMX]

Nevertheless, I advise you to familiarize yourself with the TStringGrid class in more detail.



Игорь Шевченко ©   (2010-05-15 23:59) [24]

Light-blr (15.05.10/23/22 21:XNUMX) [XNUMX]

So them, so them ...



Light-blr   (2010-05-16 00:52) [25]


> Bad © (15.05.10 23: 55) [23]

Thank you, I’m more or less familiar. but it doesn’t suit me - in it all the cells are even, and I want each line to have a different number of windows, not arranged anyhow, but aligned on both sides. In the first line, for example, there are 5 smaller windows, below them are 3 larger windows. Each window has a signature explaining what needs to be entered there. A new row is formed depending on the input in the previous row. It’s just such an applet for accessing a small database, with its own troubles - but I didn’t find any ready-made solutions that would satisfy my needs, that's why I’m writing something of my own. To use only what I already know is completely uninteresting and unpromising. And you won’t learn anything, and the program’s interface will turn out “from poverty and out of ignorance”.



turbouser ©   (2010-05-16 01:18) [26]


> Light-blr (16.05.10/00/52 25:XNUMX p.m.) [XNUMX]


> Thank you, I’m more or less familiar. but it doesn’t suit me
> -in it all the cells are smooth

OMFG ..
Well DrawGrid take .. Delov then ..



Light-blr   (2010-05-16 02:11) [27]

Thank you, the windows are more than happy with me. why offer obviously losing options when there is another solution?
it’s easier for me to write something of my own than to try to tailor something alien, but already available, to my needs - if I need to organize input in windows of different sizes and types (not only edits, but everything in a row depending on a specific need), then I will draw a dynamic formation on the form of the necessary windows, and I will not try to take the finished component from the standard set and write a million treatments for each sneeze on it.
I don’t understand the ideology “where can I get a component that catches a lion and puts it in a cage”, in the end I’m some kind of programmer, and I’m able to write a program for myself that’s not according to the principle of a slap faster, but according to the principle of how more convenient to use in the future.



Германн ©   (2010-05-16 02:21) [28]


> Light-blr (16.05.10/02/11 27:XNUMX p.m.) [XNUMX]

[24] + 1
Typing is certainly a good thing. But do not take it as a dogma.
But still, what is the interesting task? So far, apart from toys, nothing comes to mind.



Light-blr   (2010-05-17 08:55) [29]


> Hermann © (16.05.10 02: 21) [28]

very simple - automation of inputting descriptions for radio performances :)
they usually have an author and necessarily a name, and other fields (actors, directors, year of recording) may be unknown and not announced on the air, but may be many at a time, because you need the ability to dynamically create a series of windows to enter information exactly the right type. When you enter the first letters in the window in the list located on the form, possible options will appear, and here you can end the input in the window by entering a number - the number of the item in the current list, and when you switch to the next window in the previous window, full information will appear, not abbreviated input.
All this I do to speed up input - ideally it will turn out to enter at all without stopping playback, it is much easier to poke into the keyboard than to pull the hand to the mouse.
I understand that with minimal modifications it was possible to take something ready-made, albeit not with the interface you want, but it works. The problem is complicated by the fact that the input must be in two languages, and I really do not want to put a third language in addition to Russian and English. Forever you forget which one is following and you wonder what will turn out by pressing the alt-shift. During input, replacing the entered letter with the letter of another language is ideal for me.

In principle, all this is not difficult to implement, the main thing for me now is to choose the base for use. I would like to be able to carry the program on a flash drive, and run it on several computers, including strangers, where they will not be allowed to install something like a Mayesquel. It is necessary that this was just a few files with a database, access to which my program would have in any circumstances. I tried to create in OpenOffice, but did not find the ability to use it from Delphi. Now I’m thinking what to do and on which version of the base I’ll stop. Well, I really do not want to start a stationary base, but so far I don’t see any alternatives ... so that there are tables and selects, not filters.



sniknik ©   (2010-05-17 09:41) [30]

> dynamic creation of a series of windows
Well, then what is the problem? 4 properties should be added with "pointers" to neighboring ones, and in the main form should be written in onKeyUp (enable the preview of input by the form) - "if the left key and the active window have a" pointer "not setil then setfocus to it.
times dynamically, then fill out these properties once to spit.

> where to install something like mayeskuel will not give.
sqlite is embedded in the engine, FB embeded dll is nearby, access is everywhere, etc. ...



sniknik ©   (2010-05-17 10:17) [31]

type
 TEdit = class(StdCtrls.TEdit)
   LeftEdit, RightEdit, TopEdit, BottomEdit: TEdit;
 end;

procedure TForm1.FormCreate(Sender: TObject);
var
 Edit1, Edit2, Edit3,
 Edit4, Edit5, Edit6,
 Edit7, Edit8, Edit9: TEdit;

 procedure CreateEdit(var Edit: TEdit; iLeft, iTop: integer);
 begin
   Edit:= TEdit.Create(self);
   with Edit do begin
     Parent:= self;
     Left  := iLeft;
     Top   := iTop;
     Width := 90;
   end;  
 end;

begin
 CreateEdit(Edit1, 100, 100); CreateEdit(Edit2, 200, 100); CreateEdit(Edit3, 300, 100);
 CreateEdit(Edit4, 100, 150); CreateEdit(Edit5, 200, 150); CreateEdit(Edit6, 300, 150);
 CreateEdit(Edit7, 100, 200); CreateEdit(Edit8, 200, 200); CreateEdit(Edit9, 300, 200);

 Edit1.RightEdit:= Edit2; Edit1.BottomEdit:= Edit4;
 Edit2.LeftEdit := Edit1; Edit2.RightEdit := Edit3; Edit2.BottomEdit:= Edit5;
 Edit3.LeftEdit := Edit2; Edit3.BottomEdit:= Edit6;

 Edit4.RightEdit:= Edit5; Edit4.TopEdit   := Edit1; Edit4.BottomEdit:= Edit7;
 Edit5.LeftEdit := Edit4; Edit5.RightEdit := Edit6; Edit5.TopEdit   := Edit2; Edit5.BottomEdit:= Edit8;
 Edit6.LeftEdit := Edit5; Edit6.TopEdit   := Edit3; Edit6.BottomEdit:= Edit9;

 Edit7.RightEdit:= Edit8; Edit7.TopEdit   := Edit4;
 Edit8.LeftEdit := Edit7; Edit8.RightEdit := Edit9; Edit8.TopEdit:= Edit5;
 Edit9.LeftEdit := Edit8; Edit9.TopEdit   := Edit6;
end;

procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
 case Key of
   VK_LEFT:
     if (ActiveControl is TEdit) and (TEdit(ActiveControl).LeftEdit <> nil) then
       TEdit(ActiveControl).LeftEdit.SetFocus;
   VK_RIGHT:
     if (ActiveControl is TEdit) and (TEdit(ActiveControl).RightEdit <> nil) then
       TEdit(ActiveControl).RightEdit.SetFocus;
   VK_UP:
     if (ActiveControl is TEdit) and (TEdit(ActiveControl).TopEdit <> nil) then
       TEdit(ActiveControl).TopEdit.SetFocus;
   VK_DOWN:
     if (ActiveControl is TEdit) and (TEdit(ActiveControl).BottomEdit <> nil) then
       TEdit(ActiveControl).BottomEdit.SetFocus;
 end;
end;



Leonid Troyanovsky ©   (2010-05-17 14:56) [32]


> sniknik © (17.05.10 10: 17) [31]

> VK_RIGHT:

And go to edith tab :)

--
Regards, LVT.



sniknik ©   (2010-05-17 15:04) [33]

> And go to edith tab :)
What is there to do? such a fate ...;) because I want the same ... (although, taking into account Igor Shevchenko © (07.05.10 22:59) [6] I think there will not be anything terrible)



Leonid Troyanovsky ©   (2010-05-17 15:33) [34]


> sniknik © (17.05.10 15: 04) [33]

> nothing terrible will happen

And if some are used to using Edit Ctrl + Right and Shift + Right,
Yes, and Ctrl + Shift + Right too? :)

IMHO, dynamic controls are not needed here, but something is needed
like detail TDBCtrlGrid or enable additional controls / tabs
by hot key.

Well, and, in any case, organize blind input under such conditions
difficult if, of course, not dictated to write.

--
Regards, LVT.



sniknik ©   (2010-05-17 15:56) [35]

> And if some are used to ...
Yes, I do not care honestly ... I'm not going to use this, an example is purely from interest. and the author wants. may change his mind after, when complaints of inconvenience sprinkle. or maybe vice versa will become the prophet of new usability ...



Leonid Troyanovsky ©   (2010-05-17 18:32) [36]


> sniknik © (17.05.10 15: 56) [35]

> example purely out of interest.

For starters, I also drew a map :)

Then I thought: garbage is complete, to be honest.
The questioner simply didn’t introduce many plays, well,
or, poorly communicated with the introducers.

--
Regards, LVT.



Light-blr   (2010-05-19 22:38) [37]


> Leonid Troyanovsky © (17.05.10 18: 32) [36]

Well, not so much - 100 pieces. Enough to get tired.
and the program is only for me, I don’t think that anyone else will be needed.
and yes, if you use abbreviations, then the time to write down under dictation is quite enough, precisely so that I have enough, and I'm trying to implement it all. All possible actors-directors and other sound engineers have long been recognized by ear from the first letters, I tried to enter in Excel - if you do not make a mistake when entering, then enough. Now, if you miss a letter, either erase everything and retype it, or grab the mouse, but then you can exit the cell only by the enter key and go to the next window with the arrow more.
Well thought out. It only remains to implement, and so, it was gradually thought, while in the notebook everything was entered.

Thank you all for the valuable advice. I think I can handle it now.



Германн ©   (2010-05-20 02:33) [38]


> Thank you all for the valuable advice. I think I can handle it now.

God help you!
:)



Inovet ©   (2010-05-21 00:31) [39]

> [37] Light-blr (19.05.10/22/38 XNUMX:XNUMX)

It seems to me that something is wrong with the structure of the base if you need to drive in the names every time. No directories? But this is not the subject of the subject already.



Amoeba_   (2010-05-21 18:14) [40]


> every time you need to drive the names. No directories?
>

Surnames from the directory? Original!



Inovet ©   (2010-05-22 01:04) [41]

> [40] Amoeba_ (21.05.10 18: 14)
> Surnames from the directory? Original!

It's not about surnames as such, but about

> [37] Light-blr (19.05.10/22/38 XNUMX:XNUMX)
> All possible actors, directors and other sound engineers
> long recognized by ear from the first letters



Германн ©   (2010-05-22 01:38) [42]


> Amoeba_ (21.05.10 18: 14) [40]
>
>
quotedXNUMX>> every time you need to drive in the name. No directories?
>>
>
> Surnames from the directory? Original!
>

And what are the names so special? How does the list of well-known names with the possibility of adding new ones differ from, for example, the list of products sold? And even in spite of the answer
> Inovet © (22.05.10 01: 04) [41]
.



Pages: 1 2 whole branch

Forum: "Beginners";
Current archive: 2010.08.27;
Download: [xml.tar.bz2];

Top





Memory: 0.75 MB
Time: 0.161 c
15-1271534156
Igor Shevchenko
2010-04-17 23:55
2010.08.27
hands model


2-1266744427
Tim
2010-02-21 12:27
2010.08.27
passing an array to a function


15-1266870707
Pavia
2010-02-22 23:31
2010.08.27
Search algorithms.


3-1238326964
A guest.
2009-03-29 15:42
2010.08.27
Access Violation in TpFIBDatabase on first access.


2-1271746680
Who_is_you?
2010-04-20 10:58
2010.08.27
Crashes while reading from the port.





afrikaans albanian Arabic armenian azerbaijani basque belarusian bulgarian catalan Chinese (Simplified) Chinese (Traditional) croatian Czech danish Dutch English estonian filipino finnish French
galician georgian German greek haitian Creole hebrew Hindi hungarian icelandic Indonesian Irish italian Japanese Korean latvian lithuanian macedonian malay maltese norwegian
persian polish portuguese Romanian russian serbian slovak Slovenian Spanish swahili Swedish ภาษาไทย turkish Ukrainian urdu Tiếng Việt welsh yiddish bengali bosnian
cebuano Esperanto gujarati hausa hmong igbo javanese kannada Khmer lao latin maori marathi mongolian nepali punjabi somali tamil telugu yoruba
zulu
English French German Italian Portuguese Russian Spanish