It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I'm new at using Microsoft Visual Studio, but I have some knowledge about C++ language. I'd like to create object can be found in Toolbox, such as Labels, Button, etc., but without putting them onto the window by hand.
How can I do it?
Objects/Controls like labels and buttons are simply a special type of window, with associated window class and window procedure. As such, you call CreateWindowEx and supply for the second parameter, lpClassName, the class name of object/control you want to create (eg. for a label use the class name STATIC).
Check out the following tutorial for a complete example, using the BUTTON class
To create a button:
HWND hWndButton=CreateWindowEx(NULL,
"BUTTON",
"OK",
WS_TABSTOP|WS_VISIBLE|WS_CHILD|BS_DEFPUSHBUTTON,
50,
220,
100,
24,
hWnd,
(HMENU)IDC_MAIN_BUTTON,
GetModuleHandle(NULL),
NULL);`
Related
So i am making a tic tac toe game (I am a just barely beginning, and this is my first ever attempt to do anything windows), and i want to have a section where the game can keep score. I can't figure out how to add simple text to the window, like the word "SCORE" so i can put the score underneath it in a fancy little table. I have figured out how to make a text window using the following code:
CreateWindowEx(WS_EX_CLIENTEDGE, TEXT("EDIT"), TEXT("PLAYER 1"), WS_CHILD|WS_VISIBLE, 20,250,100,25,hWnd,HMENU(NULL),GetModuleHandle(NULL), NULL);
CreateWindowEx(WS_EX_CLIENTEDGE, TEXT("EDIT"), TEXT("PLAYER 2"), WS_CHILD|WS_VISIBLE, 130,250,100,25,hWnd,HMENU(NULL),GetModuleHandle(NULL), NULL);
That is useful to me for the names because the players can go in and edit the text boxes to put in their own names (if there is a better way to do this i would appreciate any tips here too). But really my question is can i make a window like this to display text that CAN'T be edited by the user?
The "EDIT" class name is for edit controls. You're looking for more of a label, and that is offered through the "STATIC" class name, along with support for an icon or bitmap rather than text.
As for the later question of how to centre it, it's one of the many static-control-specific styles you can use. The one in particular you're looking for is SS_CENTER, which can be bitwise-ORed with your two WS_* styles.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
in my project I have a list of project names and I'd like to edit the names with dynamic textboxes using angular.js. I'd like the textboxes of my projects names to become editable if I click on a button next to my project titles, and confirm the edition with another button when I'm done typing. Can I do such thing with angular.js ? I just finished the tutorial and am quite noob with it.
Actualy it is one of my most favorite example when I am doing AngularJS presentations to public :)
There is a code without single line of JS code:
http://plnkr.co/edit/ZwYA6R2e6kdhHBJAYf3V?p=preview
<span ng-hide="editing">
{{name}} <button ng-click="editing = true">Edit</button>
</span>
<span ng-show="editing">
<input type="text" ng-model="name">
<button ng-click="editing = false">Save</button>
</span>
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
Quite new to Sitecore. I need to develop a sliding image as shown on sitecore website below:
http://www.sitecore.net/
I'm cool with front-end Javascript. Could someone please help me design a template, items, components that's required to build on Sitecore? User should be able to change the images and text descriptions for the sliding content.
Thanks.
Create a new TemplateItem called e.g. SlideshowImageTemplateItem.
It should have a set of Fields that are necessary: Image, Description, Link, etc.
Now each of the images in the slideshow should be a separate Item in Sitecore tree created using the SlideshowImageTemplateItem.
Then create sublayout Slideshow and add a MultiList field to its rendering parameters which will allow you to select which slides should be displayed in the particular slideshow.
Did you take a look at the Nicam or JetStream demo sites available from Sitecore Partner Network (assuming you/your company have access)? Both have good examples of slider controls with editable text, all the Sitecore items and the related code to go with it. They also have the code changes required for a slightly different action in Page Editor mode, since you do not want the rotating action when you are editing.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
How can i retrieve the facebook post with the commnts and the profile pictures of the user through the single graph api call?
No need to fetch the image if you have the user_id of the commentor.
The URL to get the profile picture is
http://graph.facebook.com/{user_id}/picture
Infact, you can get three types of profile picture by using the graph API. That is,
http://graph.facebook.com/{user_id}/picture?type=small
http://graph.facebook.com/{user_id}/picture?type=square
http://graph.facebook.com/{user_id}/picture?type=large
P.S: I guess the types are self explanatory.
You must use batch requests in order to do that, the first request gets the comment and the seconds uses its results to get the pictures.
You should provide the batch parameter with the request as following:
batch=[
{
"method":"GET",
"name":"get-comments","relative_url":"<SOME POST ID>/comments",
},
{
"method":"GET",
"relative_url":"?ids={result=get-comments:$.data.*.from.id}&fields=picture"
}
]
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I'm working on a Facebook application and I need to select all my friends that are not fan of a specific page: any idea on how can I build the query?
UPDATE
I apologise, I'll try to be much more clear.
In my application I want to select all the friend that are not fan of a page, because I want to invite them to I Like the page.
Looking into the developer guide I read that is not possible to execute the SQL NOT IN, so using the FQL how is it possible to retrieve those friends who Not Like the page?
run this FQL query:
SELECT uid,name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me()) AND uid IN (SELECT uid FROM page_fan WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me()) AND page_id='YOUR_PAGE_ID')=''
Edit:
You must has user_likes and friends_likes permissions in order to get this data