GTK4 doesn't show mnemonics underline in a button - c

I want to set a mnemonic underline in a button called Quit, but this underline is not displayed though keyboard acceleration works by pressing ALT and the specified mnemonic key. In the code I have set use-underline to true. but it just doesn't work. I want the Q character to be underlined so that the Q character is recognizable as menemonic to the user. What am I doing wrong?
Here is my simplified main code:
#include <gtk/gtk.h>
#include <glib/gstdio.h>
static void activate (GtkApplication *app, gpointer user_data) {
GtkBuilder *builder = gtk_builder_new ();
gtk_builder_add_from_file (builder, "builder1.ui", NULL);
GObject *window = gtk_builder_get_object (builder, "window");
gtk_window_set_application (GTK_WINDOW (window), app);
gtk_widget_show (GTK_WIDGET (window));
}
int main (int argc, char *argv[]) {
#ifdef GTK_SRCDIR
g_chdir (GTK_SRCDIR);
#endif
GtkApplication *app = gtk_application_new ("org.gtk.example",
G_APPLICATION_FLAGS_NONE);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
int status = g_application_run (G_APPLICATION (app), argc, argv);
g_object_unref (app);
return status;
}
Here is my builder code:
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object id="window" class="GtkWindow">
<property name="title">Grid</property>
<child>
<object id="grid" class="GtkGrid">
<child>
<object id="quit" class="GtkButton">
<property name="use-underline">true</property>
<property name="label">_Quit</property>
<property name="has-frame">true</property>
<layout>
<property name="column">1</property>
<property name="row">2</property>
<property name="column-span">1</property>
</layout>
</object>
</child>
</object>
</child>
</object>
</interface>

Related

WINAPI: Make button text have correct visual style

I am trying to get a window to use the Windows 10 style and have succeeded in making the button itself be in that style (by modifying the executable file's manifest). However, the text is still very pixelated, reminiscent of the windows-classic style:
Setup code:
INITCOMMONCONTROLSEX initCommonControls = {
.dwSize = sizeof(INITCOMMONCONTROLSEX),
.dwICC = ICC_STANDARD_CLASSES
};
InitCommonControlsEx(&initCommonControls);
Button-create Code:
HWND startButton = CreateWindowExA(0, "BUTTON", "Start",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON | BS_VCENTER,
startButtonX, startButtonY, startButtonWidth, startButtonHeight, hWnd, NULL, hInstance, NULL);
Application manifest (the section sets the visual style):
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="*"
name="name.name.name"
type="win32" />
<description>a program</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*" />
</dependentAssembly>
</dependency>
<asmv3:application>
<asmv3:windowsSettings xmlns="https://schemas.microsoft.com/SMI/2016/WindowsSettings">
<dpiAwareness>PerMonitorV2</dpiAwareness>
<dpiAware>true</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>

Amazon Order Fulfillment with Multiple Packages for one Order _POST_ORDER_FULFILLMENT_DATA_

I have been dealing with a problem that pops up once a day. An order with multiple packages (fulfillmentdata,item). This is an order where the person may have ordered two different items and they were sent by the merchant in two different packages with different tracking numbers. Tends to be uncommon on amazon but very common in other systems.
I have tried multiple versions of the XML to try and make this work but to no success.
My first attempt:
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>XXXXXXXX</MerchantIdentifier>
</Header>
<MessageType>OrderFulfillment</MessageType>
<Message>
<MessageID>1</MessageID>
<OrderFulfillment>
<MerchantOrderID>55XXXX</MerchantOrderID>
<FulfillmentDate>2018-10-01T17:XX:XX-00:00</FulfillmentDate>
<FulfillmentData>
<CarrierCode>USPS</CarrierCode>
<ShippingMethod>First Class Parcel</ShippingMethod>
<ShipperTrackingNumber>940011590109XXXXXX</ShipperTrackingNumber>
</FulfillmentData>
<FulfillmentData>
<CarrierCode>USPS</CarrierCode>
<ShippingMethod>First Class Parcel</ShippingMethod>
<ShipperTrackingNumber>940011590109XXXXX</ShipperTrackingNumber>
</FulfillmentData>
<Item>
<AmazonOrderItemCode>354178450XXXX</AmazonOrderItemCode>
<Quantity>1</Quantity>
</Item>
<Item>
<AmazonOrderItemCode>014909917XXXX</AmazonOrderItemCode>
<Quantity>1</Quantity>
</Item>
</OrderFulfillment>
</Message>
</AmazonEnvelope>
Next I tried to split it up into two different messages
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>XXXXXXXX</MerchantIdentifier>
</Header>
<MessageType>OrderFulfillment</MessageType>
<Message>
<MessageID>1</MessageID>
<OrderFulfillment>
<MerchantOrderID>554XXX</MerchantOrderID>
<FulfillmentDate>2018-10-01T17:XX:XX-00:00</FulfillmentDate>
<FulfillmentData>
<CarrierCode>USPS</CarrierCode>
<ShippingMethod>First Class Parcel</ShippingMethod>
<ShipperTrackingNumber>94001159010920XX</ShipperTrackingNumber>
</FulfillmentData>
<Item>
<AmazonOrderItemCode>0149099174XXXX</AmazonOrderItemCode>
<Quantity>1</Quantity>
</Item>
</OrderFulfillment>
</Message>
<Message>
<MessageID>2</MessageID>
<OrderFulfillment>
<MerchantOrderID>554XXX</MerchantOrderID>
<FulfillmentDate>2018-10-01T17:XX:XX-00:00</FulfillmentDate>
<FulfillmentData>
<CarrierCode>USPS</CarrierCode>
<ShippingMethod>First Class Parcel</ShippingMethod>
<ShipperTrackingNumber>9400115901092029XXX</ShipperTrackingNumber>
</FulfillmentData>
<Item>
<AmazonOrderItemCode>3541784506XXXX</AmazonOrderItemCode>
<Quantity>1</Quantity>
</Item>
</OrderFulfillment>
</Message>
</AmazonEnvelope>
With the second message I received the following error (for both message 1 and 2):
<MessageID>2</MessageID>
<ResultCode>Error</ResultCode>
<ResultMessageCode>18028</ResultMessageCode>
<ResultDescription>The data you submitted is incomplete or invalid. For help fixing this, see http://sellercentral.amazon.com/gp/help/30721</ResultDescription>

How can I know which resource is being edited in CQ.Extjs?

I've got a dialog defined for a component:
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Dialog" xtype="dialog">
<items jcr:primaryType="cq:Widget" xtype="tabpanel">
<items jcr:primaryType="cq:WidgetCollection">
<config jcr:primaryType="cq:Panel" title="FooTab">
<items jcr:primaryType="cq:WidgetCollection">
<foo jcr:primaryType="cq:Widget"
text="Foo"
xtype="button"
name="./fooButton"
handler="function(b, e){/*what am I editing?*/};"/>
</items>
</config>
</items>
</items>
</jcr:root>
How do I know which resource is being edited by this dialog? Can I get the explicit path that is implicit in the "./" used in the name parameter? Is there some way to find it from the parameters (b = the button, e = the button click event) that are being passed to the button handler? If not, how can I get it into the button handler?
The button is on an dialog, and the dialog has the path.
So the following gives you the path:
b.findParentByType("dialog").path

AEM 6: xtype tabpanel unable to change the dimension

Is it even possible to change the dimension of a tabpanel. I tried height and width but it's not working. Any pointers.
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="cq:Dialog"
height="{Long}600"
title="Tiles"
width="{Long}850"
xtype="tabpanel">
<items jcr:primaryType="cq:WidgetCollection">
</items>
</jcr:root>
Thanks
Change the xtype on cq:Dialog to "dialog", and move the tabpanel 2 levels down, i.e.:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="cq:Dialog"
height="650"
title="Tiles"
width="850"
xtype="dialog">
<items jcr:primaryType="cq:WidgetCollection">
<tabpanel
jcr:primaryType="cq:Widget"
xtype="tabpanel">
<items jcr:primaryType="cq:WidgetCollection">
...
</items>
</tabpanel>
</items>
</jcr:root>
I have implemented the following structure and it works perfectly:
- cq:Dialog
- cq:WidgetCollection
- cq:TabPanel
- cq:WidgetCollection
- cq:Widget
- cq:Widget
...
as real life example:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Dialog"
title="Filter Component"
height="{Long}500"
width="{Long}550"
xtype="dialog">
<items jcr:primaryType="cq:WidgetCollection">
<tabs jcr:primaryType="cq:TabPanel">
<items jcr:primaryType="cq:WidgetCollection">
<tab1 jcr:primaryType="cq:Widget"
... more attributes
/>
<tab2 jcr:primaryType="cq:Widget"
... more attributes
/>
</items>
</tabs>
</items>
</jcr:root>
NOTE: Both width and height attributes must be configured explicitly in the cq:Dialog node

Camel Mina and listening on multiple ports

I have been successfully using Camel MINA for listening on a single port. I would now like to modify the configuration so that I can listen on several ports. I am not exactly sure how to do this. I have included a snip of the xml config and the associated class below:
<!-- enable Spring #Component scan -->
<context:component-scan base-package="foo.bar.hl7" />
<bean id="properties" class="org.apache.camel.component.properties.PropertiesComponent">
<property name="ignoreMissingLocation" value="true" />
<property name="locations">
<list>
<value>file:${catalina.home}/application.properties</value>
</list>
</property>
</bean>
<bean id="myhl7codec" class="org.apache.camel.component.hl7.HL7MLLPCodec">
<property name="charset" value="iso-8859-1"/>
<property name="validate" value="false"/>
</bean>
<camelContext xmlns="http://camel.apache.org/schema/spring" id="camelContext">
<contextScan />
<!-- You need to configure your socket in the endpoint.properties file -->
<camel:endpoint id="hl7listener" uri="mina2:tcp://{{endpoint.server}}:{{endpoint.port}}?sync=true&codec=#myhl7codec" />
</camelContext>
<context:annotation-config />
<bean class="foo.bar.hl7.HL7ListenerConfiguration" />
application.properties
#### HL7 Endpoint Configuration
endpoint.server=192.168.1.219
endpoint.port=9001
Component class
#Configuration
public class HL7ListenerConfiguration {
private static final Logger log = LoggerFactory.getLogger(HL7ListenerConfiguration.class);
#Bean
public RespondACK RespondACK() {
return new RespondACK();
}
#Bean
public ADTInboundRouteBuilder ADTInboundRouteBuilder() {
log.debug("Building MLLP Route");
return new ADTInboundRouteBuilder();
}
}
You need to create a hl7listener and Camel route per port you want to listen.

Resources