In C++ Builder how can I set the form's window as not resizable?
Is there some property that needs to be set?
Set the Form's BorderStyle property to one of the non-resizable styles that is not bsSizeable or bsSizeToolWin:
bsNone: Not resizable; no visible border line
bsSingle: Not resizable; minimize/maximize menu
bsDialog: Not resizable; no minimize/maximize menu
bsToolWindow: like bsSingle but with a smaller caption
This is kind of a primitive way, but it works:
Find Constrains in Object Inspector -> Properties
If you set:
MaxHeightequal to MinHeight
and
MaxWidthequal to MinWidth
this will also make your TForm non-resizable.
Related
I have created my project to fir in a portion of the form. I disabled the buttons on the top right hand side of the form(I apologize as I don't know its technical name). I would like to also disable the user from adjust the from size via the cursor. Is that possible through code in delphi?
Set the form's BorderStyle property to bsSingle; if it isn't a dynamically generated form, you can do this using the Object Inspector. Also, I understand that you have already removed biMaximize from BorderIcons (hence, you have removed the Maximize title bar button).
I assume now that this is the main form of your application. If, on the other hand, it is a dialog box displayed when you invoke a menu item (for instance), you should instead set BorderStyle to bsDialog. Such forms are also not resizable, and they have no maximize or minimize title bar buttons).
Do the following:
Set the form's BorderIcons.biMinimize = false and BorderIcons.biMaximize = false. (As I think you already have)
Assign an event handler for the form's event OnCanResize, and code it as follows:
.
procedure TForm1.FormCanResize(Sender: TObject; var NewWidth,
NewHeight: Integer; var Resize: Boolean);
begin
Resize := False;
end;
This prevents the user from resizing the form with the mouse, while the form still has the appearance of a normal form.
When I place JavaFX object inside a container, for example some checkboxes inside an hbox:
The scenebuilder controls for each checkbox show the container object in the menu (and different settings are shown here depending on the actual container):
But changing the "margin" value here, for example, clearly affects the individual checkbox and not the HBox. For example, setting only the middle checkbox to have a left margin of 20 yields a change to only the middle checkbox:
So why is that menu area labeled with the container name? I fear I am missing some fundamental design aspect by not understanding this.
They are properties of the control that are specifically available when its parent is an HBox. They correspond to the static methods HBox.setXXX(node, value), e.g. HBox.setHgrow(...).
If you put the check box in an AnchorPane instead, for example, you would see "Anchor Pane Constraints" instead of "HBox Constraints" and you would have options including "TopAnchor", "LeftAnchor" etc., corresponding to the static AnchorPane.setXXX(node, value) methods.
I understood how to create a ListStore model, a GtkTreeView and how to link them together with Glade.
Now I'd like to set the property "xalign" of one GtkCellRender. It seems I can link the attribute "xalign" to the model (I can set the relevant column in the model that stores the value of "xalign" property for that row).
However I'd like to set "xalign" property to 0.5 value for all the rows.
I was able to have this effect through code:
self.cellName.set_property("xalign", 0.5)
I'm finding a way to set the property directly in Glade, so I can avoid to write code for that.
Right click on the TreeView > Edit > Hiearchy > Select Cell Renderer > Common Properties and Attributes > Horizontal Alightment.
I'm using custom cursors and it need to be differ in some components in my screen.
When I set the cursor for Accordion, it doesn't effects title headers but effects the body of each TitledPanes. I even tried to set the cursor for each TitledPane but it doesn't effect the title header. I'm using following way to change the cursor.
ImageCursor cursor_title = new ImageCursor(cursorImg_title,cursorImg_title.getWidth() / 2,cursorImg_title.getHeight() / 2);
accordionBody.setCursor(cursor_title);
Is there a way to change the cursor in title bar of a JavaFX Accordian?
More....
I have changed the padding of title bars using css as follows. Hope it doesn't have any relation to the problem.
.titled-pane > .title {
-fx-padding: 30;
}
A TitledPane is divided into two parts :
Title
Content
When you are setting the Cursor on the Accordion, it delegates it to the content of each TitledPane, but leaves the Title. This is by design.
To force your application to change the cursor on the title as well, we need to set it on each of these nodes. We can fetch all the nodes by using the lookupAll() on the accordion and passing the styleclass they use i.e. .title. Make sure you use this after the scene graph is visible.
accordion.lookupAll(".title").forEach(node -> node.setCursor(Cursor.CLOSED_HAND));
You can use your custom cursor in place of CLOSED_HAND.
How can I set "toggle-spacing" style property to GtkMenuItem in gtk+?
I have added five GtkImageMenuItem(gtk_image_menu_item_new_with_label) to GtkMenu. Now I want to provide spacing between Image and label of this GtkImageMenuItem.
There is a style property (toggle-spacing) in GtkMenuItem to provide spacing between image and label.
How can I use this property?
I want to give alternate colors to each GtkMenuItem. How it is possible?
Kinda menu I want to create is shown in this image.
(source: flickr.com)
Thanks,
KBalar
Setting Properties.
To make the row colors alternate use gtk_tree_view_set_rules_hint.