Topic: Style?? (2)

I just found out that using the Style option from the menu to  have a nicer theme in you're software, the Autoscrol doesn't work. Realy now?? This sucks...except if someone knows a way to fix it...your her please....

Re: Style?? (2)

http://myvisualdatabase.com/forum/viewt … 335#p45335

Re: Style?? (2)

You are great!!!!!! thank you

Re: Style?? (2)

I have used the code but when I enable the autoscroll and the Windows State is maximized the scroll bar in horizontal exist but in vertical it is missing. Can you please help me?

5 (edited by k245 2022-07-28 11:42:36)

Re: Style?? (2)

The code is absolutely working, both scrollbars appear, including in the window maximization mode.

http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&item=8896&download=0

Post's attachments

Attachment icon img-2022-07-28-14-40-36.png 89.53 kb, 62 downloads since 2022-07-28 

Визуальное программирование: блог и телеграм-канал.

6 (edited by v_pozidis 2022-07-28 18:08:28)

Re: Style?? (2)

Yes you have right I found my error it works perfect. Thanks

7 (edited by v_pozidis 2022-09-14 15:31:57)

Re: Style?? (2)

I have added the following code in my program the script in the attached link
http://myvisualdatabase.com/forum/viewt … 335#p45335


i found it out when I press the Tab key to continue to the next text box. The "funny thing" is the holding the shift + tab it works ok but this is not normal


But it has changed all the TabOrder of the Text boxes and the Buttons. Even when I have the order correct in the program the result is not correct. Any idea??

Re: Style?? (2)

I don't see such an effect. It is possible that the traversal order is changing due to the addition of a scroll area. Please send a test project for analysis and solution.

Визуальное программирование: блог и телеграм-канал.

Re: Style?? (2)

k245 wrote:

I don't see such an effect. It is possible that the traversal order is changing due to the addition of a scroll area. Please send a test project for analysis and solution.

Please take a look .

Post's attachments

Attachment icon Testtab.zip 325.4 kb, 108 downloads since 2022-09-15 

Re: Style?? (2)

When transferring controls, their taborder changes. I finalized the transfer procedure and added saving the taborder.


procedure AddScrollBox( AForm:TAForm;);
var
  SB:TScrollBox;
  i: integer;
  List:TStringList; // list for storing controls taborder
begin
  List := TStringList.Create;
  List.Sorted := True;
  SB := TScrollBox.Create(AForm);
  SB.Parent := AForm;
  SB.Align := alClient;
  for i := AForm.controlCount - 1 downto 0 do
  begin
    if AForm.Controls[i] <> SB then
    begin
      // for window controls remember their taborder
      if AForm.Controls[i] is TWinControl then
        List.AddObject( IntToStr( WinControl_GetTabOrder( TWinControl(AForm.Controls[i]) ) ), AForm.Controls[i]  );
      AForm.Controls[i].Parent := SB;
    end;
  end;
  // restoring the taborder
  for i := 0 to List.Count - 1 do
  begin
    WinControl_SetTabOrder(TWinControl( List.Objects(i) ), StrToInt( List.Strings(i) ) );
  end;
  List.Free;
end;

// since in My Visual Database for window controls forgot to implement the taborder property,
// we need two auxiliary functions that need to be supplemented with all the visual components used in the project

function WinControl_GetTabOrder(AWinControl:TWinControl):integer;
begin
  if AWinControl is TdbButton then
    result := TdbButton(AWinControl).TabOrder
  else
  if AWinControl is TdbEdit then
    result := TdbEdit(AWinControl).TabOrder
end;

procedure WinControl_SetTabOrder(AWinControl:TWinControl; ATabOrder:integer);
begin
  if AWinControl is TdbButton then
    TdbButton(AWinControl).TabOrder := ATabOrder
  else
  if AWinControl is TdbEdit then
    TdbEdit(AWinControl).TabOrder := ATabOrder;
end;
Post's attachments

Attachment icon Testtab.rar 294.11 kb, 146 downloads since 2022-09-15 

Визуальное программирование: блог и телеграм-канал.

11 (edited by v_pozidis 2022-09-15 20:00:52)

Re: Style?? (2)

k245 thank you for helping me. it works about 50%. What I wonna say is that it works for some buttons and then it works again random thebtab order
I have insert your script and fixed again all the tab orders and failed, and all this is because selecting style all the forms do not have the autoscroll function even if we select it from the tool bar or insert  it l as a script.

Re: Style?? (2)

As I wrote in a comment in the script, the WinControl_GetTabOrder() and WinControl_SetTabOrder() procedures need to be improved: they need to be written in ALL visual components that have the taborder property. I hope you can do this part of the work yourself.

Визуальное программирование: блог и телеграм-канал.

Re: Style?? (2)

k245 wrote:

As I wrote in a comment in the script, the WinControl_GetTabOrder() and WinControl_SetTabOrder() procedures need to be improved: they need to be written in ALL visual components that have the taborder property. I hope you can do this part of the work yourself.


What do you mean " they need to be written in ALL visual components that have the taborder property." ???

Thank you for your help

Re: Style?? (2)

if AWinControl is TdbButton then
    TdbButton(AWinControl).TabOrder := ATabOrder
  else
  if AWinControl is TdbEdit then
    TdbEdit(AWinControl).TabOrder := ATabOrder
else
  if ...

TdbMemo
TdbCheckBox
TdbDateTimePicker
and ...

Re: Style?? (2)

sparrow wrote:
if AWinControl is TdbButton then
    TdbButton(AWinControl).TabOrder := ATabOrder
  else
  if AWinControl is TdbEdit then
    TdbEdit(AWinControl).TabOrder := ATabOrder
else
  if ...

TdbMemo
TdbCheckBox
TdbDateTimePicker
and ...

Аbsolutely right!

Визуальное программирование: блог и телеграм-канал.

Re: Style?? (2)

Thank you all so much!!!