Hi,how can I call back a line from an edit text box which gatter datas(trough a push button with sprintf) from multiple edit text boxes with a push button in guide. Practically I want to callback datas back to their original edit boxes...

8 Kommentare

Jan
Jan am 22 Mai 2022
I do not understand the question. "Data" is nothing that can be called. Only functions can be called.
Cristian Martin
Cristian Martin am 22 Mai 2022
Sorry Jan. I have 10 edit boxes in which user input numbers. Then trough a push button sends this number separated by commas into another edit box(11). Trough another push-button I want to send the numbers back to their edit text boxes for modify and other purposes. I manage to send them to edit text box 11 but I don't know how to send them back...
Cristian Martin
Cristian Martin am 22 Mai 2022
And something else if you are kind. Every time I push-button for sending datas to master edit text box 11 the old datas are overwrite, how can I do to not overwrite datas? Thank you!
dpb
dpb am 22 Mai 2022
Sounds like a really busy and difficult-to-use interface. Can't you simplify the design somehow?
But, in general you write new data to the control 'String' property using the same object handle you use to read it when you subsequently "send" that data to the master.
There is only one 'String' property value for the control; when you update it, you will replace whatever is there with the new data. It you want to append something else onto an existing data string in a control, you have to retrieve the current value, edit/append the new to it and then rewrite the 'String' value with the new, edited text.
This is certainly doable, but is a fair amount of effort to code and undoubtedly will be difficult to keep everything in synch with everything completely independent and uncorrelated like this.
I'd think either one or two tables or listboxes or even popupmenus that you add/subtract elements from would be a simpler alternative to the user.
But, we can't visualize what you're triying to control/interface to here...
Jan
Jan am 23 Mai 2022
"how can I do to not overwrite datas?" - it is less useful, if you mention, what you not want to do. Prefer to define, what you want to do instead: append the values? Build the mean of old and new values? Store the old values such that an "undo" button can reset them?
If the combines edit box contains the values as a comma separated string, split them (e.g. by strsplit) and set the original edit fields in a loop.
Actually it sounds like the data are represented redundantly in the GUI. This sounds confusing. Are you sure, that this is the easiest way?
If you post your code, it is much easier to provide some code as an answer. Inventing the code to create the original edit boxes at first would be tedious...
Cristian Martin
Cristian Martin am 23 Mai 2022
Jan I listened your advice and changed the master edit text box with an Uitable. I've managed to do some things, but I'm stucked at one point. I want to select only one row from table to delete trough a push button. So I must to get some things from cellselection part and corellate with push-button callback section.
Cristian Martin
Cristian Martin am 23 Mai 2022
function pushbutton13_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton13 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(XXXXXXXX,'CellSelectionCallBack',@(h,e) set(h,'UserData',e));
D=get(XXXXXXXX,'Data');
Index=get(XXXXXXXX,'UserData');
D(Index(1))=[];
set(XXXXXXXX,'Data',D);
pushbutton13_Callback is the delete button for selected row
I found this her but I dont knou hou to aplly it, what replace XXXXXX?
Cristian Martin
Cristian Martin am 23 Mai 2022
It's done, it was handles.uitable1

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Environment and Settings finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2015a

Gefragt:

am 22 Mai 2022

Kommentiert:

am 23 Mai 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by