Home » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » Porting a Delphi Application
Re: Porting a Delphi Application [message #11564 is a reply to message #11545] |
Mon, 17 September 2007 19:40 |
cbpporter
Messages: 1402 Registered: September 2007
|
Ultimate Contributor |
|
|
luzr wrote on Mon, 17 September 2007 10:03 |
Usual custom here, when you post some sources like this, is to use package and perhaps provide another one as demonstration - that way downloaders can just unpack to some package nest, start theide, choose the test and run it.
This is not a complaint, just a note - I guess it is time to write U++ netiquette summmary
|
I will post another improved version (current one gives error when trying to use it as base for a template layout because it misses a SetRect function with a Rect parameter) once it is ready and I'll try to have a proper package format. Previous post was only so people get an idea of what I'm trying to do (and if can be done easier point me in the right direction).
But I have a functional (barely) DropPane and now I'm trying to insert inside an array of 2x4 ToolButtons (I'm not using button because I need them to be flat-looking), like in the attached picture.
Layout and positioning is very important, so I did not use a ToolBar component, instead I hand placed all the buttons. I also need them to check when the user click on them. I managed to do this, but unfortunately I had to use pointers (old habits die hard). I wonder if there is a better way to do this in a U++ style?
layout
LAYOUT(ToolsLayout, 60, 200)
ITEM(ToolButton, btnMove, LeftPosZ(8, 22).TopPosZ(24, 22))
ITEM(ToolButton, btnEdit, LeftPosZ(30, 22).TopPosZ(24, 22))
ITEM(ToolButton, btnLine, LeftPosZ(8, 22).TopPosZ(46, 22))
ITEM(ToolButton, btnBezier, LeftPosZ(30, 22).TopPosZ(46, 22))
ITEM(ToolButton, btnRectangle, LeftPosZ(8, 22).TopPosZ(68, 22))
ITEM(ToolButton, btnEllipse, LeftPosZ(30, 22).TopPosZ(68, 22))
END_LAYOUT
code
struct ToolsDropPane: public WithToolsLayout<DropPane> {
typedef ToolsDropPane CLASSNAME;
ToolsDropPane();
void SetActive(ToolButton *btn);
};
ToolsDropPane::ToolsDropPane()
{
CtrlLayout(*this);
btnMove.Image(CBPImages::Move()).Text("Modify");
btnMove.WhenAction = THISBACK1(SetActive, &btnMove);
btnEdit.Image(CBPImages::Edit()).Text("Edit");
btnEdit.WhenAction = THISBACK1(SetActive, &btnEdit);
btnLine.Image(CBPImages::Line());
btnLine.WhenAction = THISBACK1(SetActive, &btnLine);
btnBezier.Image(CBPImages::Bezier());
btnBezier.WhenAction = THISBACK1(SetActive, &btnBezier);
btnRectangle.Image(CBPImages::Rectangle()).Text("Rectangle");
btnRectangle.WhenAction = THISBACK1(SetActive, &btnRectangle);
btnEllipse.Image(CBPImages::Ellipse()).Text("Ellipse");
btnEllipse.WhenAction = THISBACK1(SetActive, &btnEllipse);
//btnLine.Check(true);
}
void ToolsDropPane::SetActive(ToolButton *btn)
{
btn->Check(true);
}
On the other hand, you will notice that the third and fourth button doesn't have a Text. This is intentional. When I don't specify a text to a button inserted like this into a layout, I get a weird tool tip for it: "(Alt+Shift+address)". Does this mean anything?
-
Attachment: panel2.PNG
(Size: 1.88KB, Downloaded 1531 times)
|
|
|
|
|
Porting a Delphi Application
By: cbpporter on Sat, 15 September 2007 03:40
|
|
|
Re: Porting a Delphi Application
By: cbpporter on Sat, 15 September 2007 13:44
|
|
|
Re: Porting a Delphi Application
By: mirek on Sun, 16 September 2007 12:30
|
|
|
Re: Porting a Delphi Application
By: mirek on Tue, 18 September 2007 20:57
|
|
|
Re: Porting a Delphi Application
By: cbpporter on Tue, 18 September 2007 21:16
|
|
|
Re: Porting a Delphi Application
By: cbpporter on Wed, 19 September 2007 11:07
|
|
|
Re: Porting a Delphi Application
By: mirek on Wed, 19 September 2007 12:21
|
|
|
Re: Porting a Delphi Application
By: cbpporter on Wed, 19 September 2007 12:49
|
|
|
Re: Porting a Delphi Application
By: mirek on Wed, 19 September 2007 14:56
|
|
|
Re: Porting a Delphi Application
By: cbpporter on Wed, 19 September 2007 20:32
|
|
|
Re: Porting a Delphi Application
By: zsolt on Wed, 19 September 2007 21:42
|
|
|
Re: Porting a Delphi Application
By: cbpporter on Wed, 19 September 2007 21:49
|
|
|
Re: Porting a Delphi Application
By: cbpporter on Wed, 19 September 2007 22:26
|
|
|
Re: Porting a Delphi Application
By: cbpporter on Thu, 20 September 2007 18:24
|
|
|
Re: Porting a Delphi Application
By: mirek on Wed, 19 September 2007 12:18
|
|
|
Re: Porting a Delphi Application
By: cbpporter on Sun, 16 September 2007 11:16
|
|
|
Re: Porting a Delphi Application
By: mirek on Sun, 16 September 2007 12:32
|
|
|
Re: Porting a Delphi Application
By: mirek on Sun, 16 September 2007 12:24
|
|
|
Re: Porting a Delphi Application
By: cbpporter on Sun, 16 September 2007 15:49
|
|
|
Re: Porting a Delphi Application
By: cbpporter on Sun, 16 September 2007 15:51
|
|
|
Re: Porting a Delphi Application
By: mirek on Sun, 16 September 2007 20:53
|
|
|
Re: Porting a Delphi Application
By: mr_ped on Sun, 16 September 2007 23:06
|
|
|
Re: Porting a Delphi Application
By: mirek on Sun, 16 September 2007 23:42
|
|
|
Re: Porting a Delphi Application
By: cbpporter on Mon, 17 September 2007 05:48
|
|
|
Re: Porting a Delphi Application
By: mirek on Mon, 17 September 2007 09:50
|
|
|
Re: Porting a Delphi Application
By: mirek on Mon, 17 September 2007 10:03
|
|
|
Re: Porting a Delphi Application
By: cbpporter on Mon, 17 September 2007 19:40
|
|
|
Re: Porting a Delphi Application
By: mirek on Mon, 17 September 2007 22:34
|
|
|
Re: Porting a Delphi Application
By: mr_ped on Thu, 20 September 2007 19:37
|
|
|
Re: Porting a Delphi Application
By: cbpporter on Fri, 21 September 2007 20:12
|
|
|
Re: Porting a Delphi Application
By: mirek on Sat, 22 September 2007 00:22
|
|
|
Re: Porting a Delphi Application
By: cbpporter on Sat, 22 September 2007 00:25
|
|
|
Re: Porting a Delphi Application
By: mirek on Sat, 22 September 2007 01:39
|
Goto Forum:
Current Time: Tue Jun 11 00:14:56 CEST 2024
Total time taken to generate the page: 0.02172 seconds
|