Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » Bazaar » WithEnterAction compile error
WithEnterAction compile error [message #51793] Fri, 31 May 2019 10:27 Go to next message
peterh is currently offline  peterh
Messages: 46
Registered: November 2018
Location: Germany
Member
Hi,

there is an error in WithEnterAction.h:
Callback cb = B::WhenAction;

gives this error:
C:\upp/bazaar/WithEnterAction/WithEnterAction.h (16): error: conversion from 'Upp::Event<>' {aka 'Upp::Function<void()>'} to non-scalar type 'Upp::Callback' {aka 'Upp::CallbackN<>'} requested

Writing
Upp::Function<void()> cb = B::WhenAction;

or
auto cb = B::WhenAction;

Cures the problem.


This said, I must admit, I am a casual programmer and write only small tools for my own use in Job or at home.
I use C++ only to learn and experimental.
Normally I use Lazarus/Freepascal and there is the Event "OnEditingDone" which does just this and the Eventhandler method is implemented at designtime by a doubleclick into the Event list.

Because this is the only Event I normally want to use for input fields, I would wish a more comfortable solution here.

All the Best,

Peter

[Updated on: Tue, 04 June 2019 12:22]

Report message to a moderator

Re: WithEnterAction compile error [message #51803 is a reply to message #51793] Tue, 04 June 2019 09:33 Go to previous messageGo to next message
peterh is currently offline  peterh
Messages: 46
Registered: November 2018
Location: Germany
Member
Edit:
Dont mind.

I have now found, the problem is already solved.
It is already possible to define a usertype based on a template e.g. WithEnterAction<EditString> in the Layout editor.
In this case all options of EditString are available.

This feature however seems to be undocumented and without tutorial or example and not discussed in the forum.
So I needed some time to find out.

I hope, this helps new users:
index.php?t=getfile&id=5850&private=0

All the best,

Peter



  • Attachment: cats.png
    (Size: 85.29KB, Downloaded 81 times)

[Updated on: Tue, 04 June 2019 17:04]

Report message to a moderator

Re: WithEnterAction compile error [message #51852 is a reply to message #51803] Sun, 09 June 2019 19:00 Go to previous messageGo to next message
peterh is currently offline  peterh
Messages: 46
Registered: November 2018
Location: Germany
Member
I made an updated version of Bazaar/WithEnterActionTest.

Features:

Compile error fixed.
Shows alternative use of THISBACK or lambda callbacks.
Has option box to demonstrate "multipleenter" feature.
Demonstrates usage of Layout Designer with templates.
(So it also generally shows how to subclass controls that are defined in the Layout editor.)

All controls are made in the designer, rather than programatically added.

Have fun!

[Updated on: Sun, 09 June 2019 19:42]

Report message to a moderator

Re: WithEnterAction compile error [message #51853 is a reply to message #51852] Sun, 09 June 2019 19:04 Go to previous message
peterh is currently offline  peterh
Messages: 46
Registered: November 2018
Location: Germany
Member
It looks like this:
index.php?t=getfile&id=5854&private=0

Previous Topic: MATLAB .mat files handling
Next Topic: Controls4U. removed operator= in EditFile/Folder
Goto Forum:
  


Current Time: Mon Jul 22 22:47:25 CEST 2019

Total time taken to generate the page: 0.00688 seconds