Forum > Beginners

TDBNavigator - Taborder

(1/2) > >>

Int3g3r:
Hello

How can I change the tab order on the buttons in the TDBNavigator component?
Is it possible to deactivate the tab stop for individual buttons?

Does anyone have an example?

Greetings Int3g3r

Handoko:
No, you cannot do that. You might try to study the code and subclass it, but the possibility of success is not high.

Int3g3r:

--- Quote from: Handoko on May 14, 2024, 01:47:08 pm ---No, you cannot do that. You might try to study the code and subclass it, but the possibility of success is not high.

--- End quote ---

OK Thank you.

wp:
Create your own DBNavigator to have full controls over the order and type of buttons. Using DatabaseActions this is quite easy and requires no code:

* Drop a TImageList on the form; add the button icons that you need for your navigator buttons.
* Drop a TPanel on the form
* Select the TPanel and go to its ChildSizing property: Set ControlsPerLine to a value equal to or larger than the button count that you need. Set. EnlargeHorizontal and EnlargeVertical to crsAnchorAligning and Layout to cclLeftToRightThenTopToBottom.
* Add as many TSpeedButtons to the panel as you need. Due to the Childsizing they are automatically arranged to tightly fill the bounds of the panel. If you need additional spacing between the buttons, adjust the button's ChildSizing.HorizontalSpacing.
* Add a TActionList to the form
* Assign the imagelist to Images property of the ActionList.
* Double-click the ActionList. In the appearing ActionList editor, click on the down-arrow next to "+" and select "New Standard Acticon". Scroll down a bit until you see the "Database" node. Select the action that you need, for example "TDatasetPost" for the action to post a dataset. With the new action selected go to the object inspector and change the ImageIndex to the that of the required icon, and specify the linked dataset in the Dataset property.
* In the designer (or object tree) select the speedbutton which you want to use for posting. Go to its "Action" property and select the corresponding action from the list. Delete the Caption of the speedbutton.
* Repeat with the other buttons: create the corresponding action and assign it to the button
* If you later want to rearrange the order of the buttons, you select the button to be moved, right-click and pick one of the "Z-Order" commands. "Move to back" means: move the button to the very left, "Back one" moves is to the left by one position;"Move to Front"/"Forward one" do the same, but in the other direction.

* That's all. The database functionality is built into the actions.

Int3g3r:

--- Quote from: wp on May 14, 2024, 04:25:25 pm ---Create your own DBNavigator to have full controls over the order and type of buttons. Using DatabaseActions this is quite easy and requires no code:

--- End quote ---

Thank you thats great!

Where can i set a confirmation dialog?
For delete for example?

Follow code doesn't work.
The delete doesnt get executet after confirmation.

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TformMain.DataSetDelete1Execute(Sender: TObject);begin     if MessageDlg('Eintrag löschen?',mtConfirmation,[mbCancel,mbOK],0) = mrCancel then  begin    Abort;  end;end;  

Navigation

[0] Message Index

[#] Next page

Go to full version