Gtk Perl: Removing an item from a Gtk2::ComboBox by its name, rather than index - perl

While working with Perl and Gtk2, I have to programmatically remove an option from a drop-down (ComboBox). While I'm aware that $combo_box->remove_text ($position) will do the trick in one shot, I need to remove the option based on its name (entered by the user).
I'm unable to find a method that can return the index of an item by its name. Could someone help out?

It's a bit unclear what you mean by "name"; combo box items don't have names. If the combo box is textual, then each item is made up of text, but that text isn't a name. You could have the same string in all items for instance, which would make it very unclear which one you want to delete.
I think you're going to have to implement it youself, by iterating over the combo box's underlying tree model. Then it's up to you if you want to just delete the first match, continue searching to find all of them.

Related

PowerApps Get Selected Item from Lookup to make a Button Visible at the Command line bar

I want a button from the command line bar to be visible or invisible depending on whether a record has been selected in the lookup field from the main form or not.
If no record has been selected, then the button should be displayed. Otherwise not.
For this problem, I want to use the Power Fx in PowerApps, but I haven't found a command yet, which shows me the content or something like that of the lookup field. Other field data types like text have worked without problems.
With Javascript, I already managed it without problems, but I would like to do it also in PowerFx if that should work.
Screenshot: https://i.stack.imgur.com/uqDJ6.png
The records come from the Table Company, where the attribute is Companyname.
Commands where I think they might work:
If([Selected Record];true;false);If(IsBlank([Selected Record]);true;false);If(IsBlankOrError([Selected Record]);true;false);If(IsEmpty([Selected Record]);true;false)
I guess there are 2 scenarios:
The Lookup form control element is a Dropdown with a Selected output property. Then your approach would work like If(IsBlankOrError(DataCardValue1.Selected),true,false)
If your form control element is a ComboBox then you could use If(CountRows(DataCardValue1.SelectedItems)>0,true,false) or the above described IsBlankOrError.

Set backend title for Mask-Elements in Typo3

I have a Typo3 server. On that I created some different content elements with mask.
In this elements there are often repeating content, like texts or other stuff.
So the editors make a new element in the backend, there they can add a headline and as much text parts as they want.
Often it looks like this:
Thats good, the editor can see a "preview" of the textparts. In this example "Karriere,Partner...". This naming happens automatically.
My Problem is, some times there arent any titles. Its always "No title". As an editor its quite hard to find the right dropdown to edit some stuff, you mostly have to open all dropdowns and search for the right one.
Its look then like this:
In both elements there are some string inputs that are very good for the title.
So my question is, how is mask gonna choose the title? Its not the first string input.
And secondly, can I tell Mask that they have to choose input field XYZ as title?
Heyo
Yes, you can tell Mask which field to use as a title for inline elements (like repeating contents). When you're setting up a new Mask element, right below the "Label" field of the repeated inline element, there is a field "Field that should be used as label for inline element (starting with tx_mask_)". This will be used as the title that is displayed in the backend. In the placeholder of that field, it explicitly says that "If empty, first field is used".
So, if your inline element has a field "my_awesome_header" which you would like to use as the title in the backend, set the above to "tx_mask_my_awesome_header".
I am not certain as to why it does not display anything in your second example. It might be that either the first input field is not a string, or the first input field is a string but it is empty.
I hope this helps. Let me know if you need further clarification.
Edit: Since that question came up, it should be possible to set a static default title to the containing Mask element using mod.wizards.newContentElement.wizardItems.mask.elements.[name of the mask element].tt_content_defValues.header = My awesome static title. As I said in the comments, though: I always give my Mask elements a header field and let editors fill that in.

Is it possible to capture checkbox selection(crossmark like X) on flatten pdf

I had an editable pdf with checkbox, after selection i flatten that pdf. from that flatten pdf i need to read the checkbox selection which is looks like crossmark(X), is there any possibility to read that checkbox selection.
When you flatten a PDF, you take away all interactivity. If you have a check box field in an interactive form, and you flatten that form, the check box field is gone. That is the concept of flattening.
What happens in practice?
A check box field has two appearances. One appearance is Off. This appearance can be a path such as a simple square defined as a rectangle. Another appearance can have any name On, Yes, 1 or whatever is defined in the original form. The corresponding appearance can be the same square as the Off appearance with two extra lines that look like a cross, or the square with a character that looks like a check mark, or whatever was defined in the original form.
When you flatten the form, you throw away the name of the check box field, you throw away the widget annotation that corresponds with the field, and you throw away one appearance state (depending on the value of the check box field). The only thing that is left, is one of the two appearances.
If you no longer have the original form, you have no clue as to what this appearance could look like, hence you have no idea what to look for, nor where to look for a specific appearance.
You say that the appearance looks like a cross mark in your case, but whoever reads this question has no idea if this cross mark is a path that was constructed in graphics state, or a glyph that was added in text state.
Long story short: if you flatten first and then expect to be able to read a field value, your design is seriously flawed.
You have to ask yourself: why do I need to flatten the form? Maybe it's sufficient to make the fields read-only. If that's not sufficient, why don't you add an attachment to the PDF that contains the original field values? There are many different ways to work around your problem.

delete selected item from text item

i have got multi lined text item like gridview in my forms project. i want to select an item and click delete button and the system must delete selected index but i didnt find the perfect function. it's not bind into the database so its not complicated i just want to delete the line from the text item. i tried to find the properties of the current record, i use some of loops but it didnt find the selected item index. does it have "selected item" function like c#, java. Or do i have to create a function to find selected item. which way is the best and how could i do that.
This code may help you(I didn't get a chance to test this) :
GO_BLOCK('Gridview_BLOCK_NAME');
GO_RECORD(record_index);
DELETE_RECORD;
GO_ITEM('block.delete_button');--if you want the cursor back to delete button

DataGridViewComboBoxCell selectioindexchange event

I have a data-grid and three column in it. one column is type of DataGridViewComboBoxCell, three items are in this grid combo box, now i have to invoke selection index changed event to change value according to combo value change in grid.
also help me to make a new event ....
please help...
thanks
I really can't understand your question.
But maybe these informations can help:
A ComboBoxColumn has always two kinds of controls. A presenting one (in most cases a label) which is individually for each row. And a editing one that will be shared for the whole column. So take a look into this documentation and the IDataGridViewEditingControl Interface.
Maybe these will give you a starting point on how to solve your problem.
In the Load event for the form, you need to get the cell that you want to add the handler to and cast it as a regular combo box. You can then add the event handler on SelectedIndexChanged, but it must be done programmatically, and depending on the language you are using.