U++ framework
Do not panic. Ask here before giving up.

Home » Developing U++ » UppHub » My Simple U++ Application
My Simple U++ Application [message #6013] Sat, 28 October 2006 09:21 Go to next message
yeohhs
Messages: 75
Registered: November 2005
Location: Malaysia
Member
This is a U++ program (version 0.0.1 alpha) released for testing and comments.

Features implemented
1. Splash screen
2. About dialog
3. Menu and popup menu
4 Toolbar
5. Status bar
6. Options dialog
7. Help (using Topic++)
8. Editors dialog (only shows DocEdit and LineEdit)
9. use of .rc file to embed program icon and version info.

This program is meant as a simple template program which I will use to explore the various aspects of U++.

I'm still new to U++ so I would appreciate any ideas or suggestions on this simple template. I want to get it right so that later I will write an article that explains how this program works.

Thanks in advance
Yeoh
--
This version is obsolete so I have deleted it. The latest version is in a later posting below.

[Updated on: Tue, 31 October 2006 14:53]

Report message to a moderator

Re: My Simple U++ Application [message #6017 is a reply to message #6013] Sat, 28 October 2006 18:55 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1221
Registered: March 2006
Location: Italy
Senior Contributor
yeohhs wrote on Sat, 28 October 2006 09:21

This is a U++ program (version 0.0.1 alpha) released for testing and comments.

Features implemented
1. Splash screen
2. About dialog
3. Menu and popup menu
4 Toolbar
5. Status bar
6. Options dialog
7. Help (using Topic++)
8. Editors dialog (only shows DocEdit and LineEdit)
9. use of .rc file to embed program icon and version info.

This program is meant as a simple template program which I will use to explore the various aspects of U++.

I'm still new to U++ so I would appreciate any ideas or suggestions on this simple template. I want to get it right so that later I will write an article that explains how this program works.

Thanks in advance
Yeoh




Hi Yeoh,

very nice work! It was helpful for me. I was still unaware of Topic and how to use it. U++ is a continue surprise for me. But now I filled the gap.
Please continue on this line, with very simple interaction among widgets... sorry, controls. When all normal controls are covered perhaps a simple application about sqlite would be greatly appreciated by our forum.
Many thanks,

Luigi
Re: My Simple U++ Application [message #6029 is a reply to message #6017] Sun, 29 October 2006 03:54 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Comments:

I feel a little bit uneasy calling exploreEditors in constructor. In my book, that is not a very good practice, I would rather make it a separate call...

I would rather used TimeCallback for Splash - direct use of "timer ID" comes with danger of ID clash - there is even some "protocol" about enumerating these IDs to avoid this (see e.g. ToolBar). TimeCallback wastes a little space, but is easy to use.

"Ini" configuration format is OK, but least important. Usually, we use binary serialization for .cfg files (Serialize method, operator%) or CParser or Xml(ize).

MIrek
Re: My Simple U++ Application [message #6032 is a reply to message #6029] Sun, 29 October 2006 04:12 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
P.S.:

I usually place more than single layout in .lay file, but this one is rather matter of personal preferences...
Re: My Simple U++ Application [message #6038 is a reply to message #6017] Sun, 29 October 2006 05:53 Go to previous messageGo to next message
yeohhs
Messages: 75
Registered: November 2005
Location: Malaysia
Member
Hi Luigi,

Thanks for testing it. I'm glad it helps.
Yes, I will do one for SQLite.

Best Regards,
Yeoh

[Updated on: Sun, 29 October 2006 06:03]

Report message to a moderator

Re: My Simple U++ Application [message #6039 is a reply to message #6029] Sun, 29 October 2006 06:02 Go to previous messageGo to next message
yeohhs
Messages: 75
Registered: November 2005
Location: Malaysia
Member
Hi Mirek,

Thank you very much for your comments. You're absolutely right about calling member function in constructors. I will put a "load" button in the lay file to call the function. Smile

Thanks. I will learn how to use TimeCallback.

U++ is great. It provides several ways for handling cfg files. I dislike registry. In future U++ apps, I will use the several methods you mentioned.

Best Regards,
Yeoh
--
P.S. Yes, I prefer to use one lay file for each class. My idea is to have 4 files in each class: cpp, h, lay and iml. If the class needs more than one layout, it will be in the lay file for that class. I suppose there is a U++ coding style somewhere in the documentation. I will search for it. Smile


Re: My Simple U++ Application [message #6046 is a reply to message #6039] Sun, 29 October 2006 08:28 Go to previous messageGo to next message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
to help you some with TimeCallback:
http://www.arilect.com/upp/forum/index.php?t=msg&goto=38 80&#msg_3882
It is about letting a Label bling by using a TimeCallback

Bas
Re: My Simple U++ Application [message #6052 is a reply to message #6013] Sun, 29 October 2006 10:52 Go to previous messageGo to next message
yeohhs
Messages: 75
Registered: November 2005
Location: Malaysia
Member
Hi Bas, Smile

Thanks. This forum has tons of useful information.

Best Regards,
Yeoh
Re: My Simple U++ Application [message #6056 is a reply to message #6013] Sun, 29 October 2006 11:42 Go to previous messageGo to next message
yeohhs
Messages: 75
Registered: November 2005
Location: Malaysia
Member
Here is the revised version. Smile

Changes
1. it now has load buttons to load text into DocEdit and LineEdit controls.
2. splash screen now uses TimeCallback object
3. bug fix: popup menu

Thanks and best regards,
Yeoh
--
File attachment deleted.
This version is obsolete so I have deleted it. Please see posting below for the latest version. Thanks. Smile


[Updated on: Fri, 10 November 2006 14:44]

Report message to a moderator

Re: My Simple U++ Application [message #6397 is a reply to message #6013] Fri, 10 November 2006 14:42 Go to previous messageGo to next message
yeohhs
Messages: 75
Registered: November 2005
Location: Malaysia
Member
Hi,

This is the latest version of my simple U++ program.

It now covers all of the "most frequently used" controls as shown in the layout editor. This version only shows how to create the control and set, get values from the control. No fancy or complicated C++ code. Smile

Also, there is a custom USC file for UPX compression and file deletion.

Thanks and best regards,
Yeoh
--
P.S. This program was built using U++ 611-dev1 version and tested on Win2000 with MSC8 Optimal Build.

Obsolete attachment removed. Please see corrected version below.

[Updated on: Sat, 11 November 2006 17:39]

Report message to a moderator

Re: My Simple U++ Application [message #6399 is a reply to message #6397] Fri, 10 November 2006 16:30 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
Cool , thanks !

I got two errors where you explicitely give the class qualifier in the class declarations.

Matthias
Re: My Simple U++ Application [message #6400 is a reply to message #6399] Fri, 10 November 2006 18:16 Go to previous messageGo to next message
yeohhs
Messages: 75
Registered: November 2005
Location: Malaysia
Member
Hi Matthias,

Thanks for reporting the errors.
They were in LineEditor.h and DocEditor.h.
Fixed! Smile

Best Regards,
Yeoh
--
Re: My Simple U++ Application [message #6402 is a reply to message #6400] Fri, 10 November 2006 20:17 Go to previous messageGo to next message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member

Yeoh

Nice work. On my system the window was positioned off screen at startup and I had to use the system menu to move it back on screen - i.e. Alt Space -> M -> use left arrow key to bring the window in view. Using Windows cascade or tile wouldn't bring the window in view for some reason. (Win XP).

I have a 20 inch widescreen LCD - 1680 by 1050 or something.

Graeme
Re: My Simple U++ Application [message #6407 is a reply to message #6402] Sat, 11 November 2006 10:56 Go to previous messageGo to next message
yeohhs
Messages: 75
Registered: November 2005
Location: Malaysia
Member
Hi Graeme,

Thanks for reporting. This is strange as I assumed the main window automatically centers itself on the screen with the correct Z order. You're right about this too. I noticed that sometimes when I run it from theIDE, it is "hidden". There must be a Z order problem somewhere.

I'll have to look into the U++ source to see what is really happening. Smile

Will post a revised version soon.

Best Regards,
Yeoh

[Updated on: Sat, 11 November 2006 10:59]

Report message to a moderator

Re: My Simple U++ Application [message #6408 is a reply to message #6407] Sat, 11 November 2006 11:47 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
What about simply looking at TopWindow docs? Smile

(OK, I know - it is unusual to have things documented in U++ Smile

(OTOH, right now, only undocumented basic widgets those in Static.h and ScrollBar.h).

Mirek
Re: My Simple U++ Application [message #6409 is a reply to message #6407] Sat, 11 November 2006 11:58 Go to previous messageGo to next message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member

I should have been more helpful and said it's only off-screen the first time or if I delete the config (.cfg) file. If the config file is present the app comes up in centre screen. Also the splash window is always centre screen.

Splash=0
SaveWinPos=0
PosX=0
PosY=0

I'll see what else I can find.

Graeme
Re: My Simple U++ Application [message #6410 is a reply to message #6409] Sat, 11 November 2006 12:05 Go to previous messageGo to next message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member

Looks like it's just that you don't initialize class members mainwposx_ posy if there's no config file.

Graeme
Re: My Simple U++ Application [message #6418 is a reply to message #6410] Sat, 11 November 2006 14:40 Go to previous messageGo to next message
yeohhs
Messages: 75
Registered: November 2005
Location: Malaysia
Member
Yes, that's it. Thanks, Graeme.

Fixed version now uploaded! Smile


Obsolete attachment deleted.

[Updated on: Mon, 13 November 2006 17:52]

Report message to a moderator

Re: My Simple U++ Application [message #6432 is a reply to message #6418] Sun, 12 November 2006 19:47 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
Hi Yeoh,

I had tested your application under FreeBSD (it was winXP before) and I got an error, but I don't know what the reason is.

/home/masu/projects/upp/MyUppApp/MyUppApp.iml:4: error: expected unqualified-id before numeric constant


So I commented the affected line and it seems that it is not needed at all.

Matthias


931b81e7ea53320dccc37375b34b38c3
Re: My Simple U++ Application [message #6441 is a reply to message #6432] Mon, 13 November 2006 04:24 Go to previous messageGo to next message
yeohhs
Messages: 75
Registered: November 2005
Location: Malaysia
Member
masu wrote on Mon, 13 November 2006 02:47


So I commented the affected line and it seems that it is not needed at all.
Matthias


Hi Matthias,

Thanks for testing it under FreeBSD. Smile
Yes, you're right. The "Complex" image in MyUppApp.iml is now not used. MSC8 did not detect this! I must look at the compiler options again.

Fixed! Smile Corrected version now uploaded.

Best Regards,
Yeoh
--
P.S. File attachment deleted. Please see latest upload below.


[Updated on: Tue, 19 December 2006 15:27]

Report message to a moderator

Re: My Simple U++ Application [message #7226 is a reply to message #6013] Tue, 19 December 2006 01:03 Go to previous messageGo to next message
Balage is currently offline  Balage
Messages: 17
Registered: December 2006
Promising Member
I cannot download. Zero bytes come down.
Why's that?
Re: My Simple U++ Application [message #7233 is a reply to message #7226] Tue, 19 December 2006 09:25 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1221
Registered: March 2006
Location: Italy
Senior Contributor
Balage wrote on Tue, 19 December 2006 01:03

I cannot download. Zero bytes come down.
Why's that?


Hello,

do not try to open directly, but at the download prompt use save option instead. Then it should appear.
Luigi
Re: My Simple U++ Application [message #7234 is a reply to message #6013] Tue, 19 December 2006 10:10 Go to previous messageGo to next message
Balage is currently offline  Balage
Messages: 17
Registered: December 2006
Promising Member
That's not the problem. It's after I save the file (with Firefox), the resulting file is 0 bytes in size.

If I try with konqueror, I can also select the dl dir, but as soon as the dl begins, I get this:
"Connection to host www.ultimatepp.org is broken."
Re: My Simple U++ Application [message #7238 is a reply to message #7234] Tue, 19 December 2006 11:02 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 702
Registered: December 2005
Location: Budapest, Hungary
Contributor
I think, uploaded files disappeared after forum migration.
Re: My Simple U++ Application [message #7250 is a reply to message #6013] Tue, 19 December 2006 15:12 Go to previous messageGo to next message
yeohhs
Messages: 75
Registered: November 2005
Location: Malaysia
Member
Hi,

I've uploaded the latest version.
It now uses some Windows specific code for storing the config file.

Also, wrote the initial draft Table of Contents in the Topic++ file and will be planning and writing the tutorial in the Topic++ files. Wink

Best Regards,
Yeoh
--
Obsolete attachment deleted.

[Updated on: Fri, 22 December 2006 14:06]

Report message to a moderator

Re: My Simple U++ Application [message #7328 is a reply to message #6013] Fri, 22 December 2006 14:05 Go to previous messageGo to next message
yeohhs
Messages: 75
Registered: November 2005
Location: Malaysia
Member
Hi,

This version uses Upp namespace.

Merry Christmas and a Happy 2007 to all. Smile

Best Regards,
Yeoh
--

Re: My Simple U++ Application [message #7415 is a reply to message #7250] Thu, 28 December 2006 10:44 Go to previous messageGo to next message
AngelPortal is currently offline  AngelPortal
Messages: 13
Registered: December 2006
Promising Member
could tell me how to compile the program?
I new on U++ and would like to have some tips in how to use it.

Angel Portal
angelp@correios.net.br
Re: My Simple U++ Application [message #7416 is a reply to message #7415] Thu, 28 December 2006 10:49 Go to previous messageGo to next message
AngelPortal is currently offline  AngelPortal
Messages: 13
Registered: December 2006
Promising Member
all the iml file are empty!!!
Re: My Simple U++ Application [message #7428 is a reply to message #7415] Fri, 29 December 2006 06:11 Go to previous messageGo to next message
yeohhs
Messages: 75
Registered: November 2005
Location: Malaysia
Member
AngelPortal wrote on Thu, 28 December 2006 17:44

could tell me how to compile the program?
I new on U++ and would like to have some tips in how to use it.

Angel Portal
angelp@correios.net.br


Hi,

Use 7-Zip to unpack the 7z file into your MyApps folder. Then run TheIDE and you should see MyUppApp package in the MyApps assembly.

You can then open the MyUppApp package and compile the package.

Best Regards,
Yeoh
Re: My Simple U++ Application [message #7429 is a reply to message #7416] Fri, 29 December 2006 06:27 Go to previous messageGo to next message
yeohhs
Messages: 75
Registered: November 2005
Location: Malaysia
Member
AngelPortal wrote on Thu, 28 December 2006 17:49

all the iml file are empty!!!


Hi,

This is strange!

This version was built using Ultimate++ 612-dev2, compiled with MSC8 Optimal build and tested on Windows 2000.

Best Regards,
Yeoh
Re: My Simple U++ Application [message #8048 is a reply to message #7429] Mon, 05 February 2007 21:00 Go to previous messageGo to next message
DuncanShortland is currently offline  DuncanShortland
Messages: 45
Registered: January 2006
Member
Downloaded the myuppapp example successfully.

Compiling using 612-dev3 with MSC8 compiler.

Comes up with the following errors all in shlobj.h

The ID's before in first 4 cases are COORD and the last NETRESOURCE.


Any suggestions as to what I am doing wrong.

The errors:

D:\packages\Include\shlobj.h(1063) : error C2146: syntax error : missing ';' before identifier 'dwScreenBuffe
rSize'
D:\packages\Include\shlobj.h(1063) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
D:\packages\Include\shlobj.h(1063) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
D:\packages\Include\shlobj.h(1064) : error C2146: syntax error : missing ';' before identifier 'dwWindowSize'

D:\packages\Include\shlobj.h(1064) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
D:\packages\Include\shlobj.h(1064) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
D:\packages\Include\shlobj.h(1065) : error C2146: syntax error : missing ';' before identifier 'dwWindowOrigi
n'
D:\packages\Include\shlobj.h(1065) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
D:\packages\Include\shlobj.h(1065) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
D:\packages\Include\shlobj.h(1068) : error C2146: syntax error : missing ';' before identifier 'dwFontSize'
D:\packages\Include\shlobj.h(1068) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
D:\packages\Include\shlobj.h(1068) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
D:\packages\Include\shlobj.h(3577) : error C2146: syntax error : missing ';' before identifier 'nr'
D:\packages\Include\shlobj.h(3577) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
D:\packages\Include\shlobj.h(3577) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
Re: got error "PathAppend undefined" [message #18110 is a reply to message #6013] Wed, 10 September 2008 19:22 Go to previous message
amando1957 is currently offline  amando1957
Messages: 57
Registered: November 2007
Location: Wien/Vienna/Viden
Member
Hi to all,

Tried to run it at WIN2K with 2008.1, but got the following (excerpt):
C:/upp/out/MyUppApp/MINGW.Debug.Debug_full.Gui.Main\$blitz.o: In function `_ZN8MyUppApp11che
	ckConfigEv':
D:/upp/MyApps/MyUppApp/MyUppApp.cpp:313: undefined reference to `__imp__PathAppendA@8'
D:/upp/MyApps/MyUppApp/MyUppApp.cpp:315: undefined reference to `__imp__PathAppendA@8'
D:/upp/MyApps/MyUppApp/MyUppApp.cpp:339: undefined reference to `__imp__PathAppendA@8'
D:/upp/MyApps/MyUppApp/MyUppApp.cpp:340: undefined reference to `__imp__PathAppendA@8'
C:/upp/out/MyUppApp/MINGW.Debug.Debug_full.Gui.Main\$blitz.o: In function `_ZN7OptionsC1Ev':


The only files were "PathAppend" can be found in are "MyUppApp.cpp" and "Options.cpp". Interesting that following code:
#ifdef flagWIN32	
	TCHAR szPath[MAX_PATH];
	SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, szPath);
	PathAppend(szPath,"MyUppApp");
	PathAppend(szPath, cfgfile);
	fullpathtocfgfile = szPath;
#else
	fullpathtocfgfile = cfgfile;
#endif

can be found in both.
@Yeoh: that's intended? Seems to be redundant code.

Commenting one of them had the effect that the errors from before were gone, but got the missing "szPath", which is not a miracle.
Anyone has a hint for me please?

kind greets
Martin
Previous Topic: Shared object with auto locking strategy
Next Topic: Bazaar - Call of duty
Goto Forum:
  


Current Time: Sat Apr 25 16:26:08 GMT+2 2026

Total time taken to generate the page: 0.01443 seconds