resource IDs in VC++ - visual-c++

I define resource IDs as below:
#define _RESOURCE_ID 150
#define IDR_OPBUTTON _RESOURCE_ID + 10
When I use below code to change the text of button, it doesn't work:
SetDlgItemText(hWnd, IDR_OPBUTTON, _T("-"));
But if I give it a number directly, it does work:
#define IDR_OPBUTTON 160
Can anybody tell me why? Thanks in advance!
Also, I tried function GetDlgItemInt for a textbox, it has the same behavior.

Did you try to put parenthesis?
#define IDR_OPBUTTON (_RESOURCE_ID + 10)

Related

How to get Text Input (Tizen Native App)

I have been working on a Tizen project where I need to calculate BMI of a person. So i need to take input of the name of the user and the height and weight from the user. So far I have created a functional interface where I can navigate users to the options. I can prompt for input and keyboard pops up. But I am not sure how to take and save the input in a variable like we do on android : int/String x = editText.getText()
I have searched a lot, but the tizen community seems a bit more advanced on documentation. Any help will be appreciated. below are some of the code for edit text (for text input). I just need to know how I can extract the input value from it.
Edit Text code:
static Evas_Object *
create_singlelines_editfield_layout(Evas_Object *parent) {
Evas_Object *editfield, *entry, *button, *buttonOk;
editfield = elm_layout_add(parent);
elm_layout_theme_set(editfield, "layout", "editfield", "singleline");
evas_object_size_hint_align_set(editfield, EVAS_HINT_FILL, 0.5);
evas_object_size_hint_weight_set(editfield, EVAS_HINT_EXPAND, 0.5);
entry = elm_entry_add(editfield);
elm_entry_single_line_set(entry, EINA_TRUE);
elm_entry_scrollable_set(entry, EINA_TRUE);
elm_object_part_text_set(entry, "elm.guide", "Enter Your Weight");
evas_object_smart_callback_add(entry, "focused", editfield_focused_cb, editfield);
evas_object_smart_callback_add(entry, "unfocused", editfield_unfocused_cb, editfield);
evas_object_smart_callback_add(entry, "changed", editfield_changed_cb, editfield);
evas_object_smart_callback_add(entry, "preedit,changed", editfield_changed_cb, editfield);
elm_object_part_content_set(editfield, "elm.swallow.content", entry);
//elm_object_part_content_set(editfield, "elm.swallow.button", button);
return editfield;
}
Thanks
char const * const text = elm_entry_entry_get(ad->input);
You can see it in action with :
https://github.com/rzr/ekzekuto

Matlab - Using symbols in gscatter

Ok, so I'm trying to use gscatter to plot 8 different points in a figure. These 8 points are all different and thus I want to give them different symbols. I know that gscatter will automatically assign them different colors, but I also want to be able to use the figure in black and white. I have written the following code:
lincol = {'k';'k';'k';'k';'k';'k';'k';'k'};
linsym = {'+';'o';'*';'.';'x';'s';'d';'^'};
limits = [-1 1 -1 1];
close all
for i = 1:3;
figure(i); hold on
gscatter(RfootXdistpertRel(:,i),RfootYdistpertRel(:,i),lincol,linsym);
legend('Pert1', 'Pert2', 'Pert3', 'Pert4', 'Pert5', 'Pert6', 'Pert7', 'Pert8')
hline(0);
vline(0);
axis(limits);
end
According to the matlab syntax, I should be able to specify color and marker symbol in this way (gscatter(x,y,col,sym)). The variables used are 8 by 1 vectors, just as the lincol and linsym. However, it gives me an error:
Error using plot
Color value must be a 3 or 4 element vector
Can anyone help? It's just such a silly problem to have.
Luc
It seems that you have some errors in your code. The syntax for gscatter should include at least 3 parameters : x, y and group. It seems that group is missing.
Furthermore the definition of color and sym may be wrong. Try col = 'kkkkkkkk'; instead of lincol = {'k';'k';'k';'k';'k';'k';'k';'k'};.
I hope this helps.
Regards.
Jonay

change susy $total-columns on pc view

Im trying to change $total-columns like this:
#include at-breakpoint(55em 12)
$total-columns: 12
as suggested here:
Susy: change the number of columns according to screen size
but I cant get it to work.
I start off by setting _base with
$total-columns: 5
I designed for mobile,
but in a pc-view I want the container to have 12 columns.
Am I missing anything?
According to the Susy reference maybe try the following (Depending if 60em should be your min or max value):
$media-layout: 12 60em; // Use 12 cols up to max 60em.
or
$media-layout: 30em 12 60em;// Use 12 cols between min 30em & max 60em.
or
$media-layout: 60em 12; // At min 60em, use 12-col layout.
Take the defined variable and enter that variable in the mixin:
#include at-breakpoint($media-layout)

How can I get the text in QTableWidgetItem

I create a QWizard page, in the page, there is a QTableWidge include 4 rows and 6 cols, in each cell, I create a QTableWidge contains 2 rows and 1 col, we can input text to these small cells. Now I want to get all changed text before go to next page. What can I do? Thanks.
can not upload picture......
Use signals/slots to create a method that is run on when the following signal is emitted:
void QTableWidget::itemChanged ( QTableWidgetItem * item ) [signal]
with connect:
connect(tableWidget, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(on_table_item_changed(QTableWidgetItem*)));
Sorry about the formatting.

How can I achieve this kind of List in BlackBerry?

I am making my first application for BlackBerry (OS 6.0+) and I have to define a screen like in the image below. I have read about RichList but its not allowed to be added below the other components.
What I want is the part (list) below the wide ButtonField. The white boxes should contain images and the scribbles in front of it should contain text. This "list items" are populated dynamically.
As you can see, this very-much resembles the layout of a RichList, but I can't seem to add it to the VerticalFieldManager that I have used as the main container of components.
So if anyone can help me get this screen, I'm really grateful! Thanks in advance.
You need to implement ListFieldCallback and overwrite all methods. There you will see "drawListRow" method. You need to draw Images on left and text on write on this method index wise. like this:-
ListData ld = (ListData) rows.elementAt(index);
g.drawText(ld.name, 30+extraSpaceDelete, y
+ (listItemHeight - g.getFont().getHeight()) / 2);
g.drawText(ld.address, 30+extraSpaceDelete, (y
+ (listItemHeight - g.getFont().getHeight()) / 2)+(g.getFont().getAscent()+10));
g.drawBitmap(0, y + listItemH - 3, Display.getWidth(), 3,
separator_line, 0, 0);

Resources