Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Klindarin

Having a little problem with adding in word wrap

This topic is 5573 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I would like to add word wrap to the bottom code but as I was going through a tutorial and writing a little of my own and taking some excerpts from the tutorial im not 100% sure how or where to add word wrap in. The text just disappears after it exceeds the length of the output box. Is there a WS_ or LBS_ thing I could put within in the Output box window that would put word wrap? case EN_UPDATE: // Get the text from the edit box GetWindowText(hEB_InputField,szMessage,256); // Check if they pressed enter if ( szMessage[strlen(szMessage)-1] == 10 ) { // Get rid of trailing garbage szMessage[strlen(szMessage)-2] = ''\0''; GetWindowText(hEB_InputName,szMyName,32); sprintf(szCompMessage,"<%s> %s", szMyName, szMessage); // clear input field SetWindowText(hEB_InputField,""); // // Send a chat packet to the server // ChatMsg.dwSize = sizeof(PacketChat); ChatMsg.dwType = PACKET_TYPE_CHAT; strcpy(ChatMsg.szText,szCompMessage); // Convert the packet to a void stream packet = (VOID*)&ChatMsg; // Send the chat packet hReturn = hrSendClientMessage(PACKET_TYPE_CHAT,packet); } } break; } Another part of the code I am adding in is a 2nd box that updates when a User connects. The server accepts new people logging in by assigning "Slots" to them Slot0 = me Slot1 = Guest2 Slot2 = Bill etc.. Would it be easier for me to just upload the Slot settings into that window to show the users connected or is there an easier where or more efficient? Any help would be appreciated.

Share this post


Link to post
Share on other sites
Advertisement
If you are using an Edit Box you can set the style ES_MULTILINE to get word wrap.

If you are using a List Box MSDN has this note:

"LBS_NOINTEGRALHEIGHT The size of the list box is exactly the size specified by the application when it created the list box. Usually, Windows sizes a list box so that the list box does not display partial items."

So make sure you do not have this style set. If this fails to work you have to make the control wide enough to hold your entire string OR make it owner draw and implement word wrap yourself.

Good Luck.

Share this post


Link to post
Share on other sites
If you are using an Edit Box you can set the style ES_MULTILINE to get word wrap.

If you are using a List Box MSDN has this note:

"LBS_NOINTEGRALHEIGHT The size of the list box is exactly the size specified by the application when it created the list box. Usually, Windows sizes a list box so that the list box does not display partial items."

So make sure you do not have this style set. If this fails to work you have to make the control wide enough to hold your entire string OR make it owner draw and implement word wrap yourself.

Good Luck.

Share this post


Link to post
Share on other sites
Yeah Im using a List box its what the tutorial was based on.

I was wondering what would be easier to try to manuelly write in word wrap or try to switch the Output box as an Edit Box?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!