Mercurial Hosting > editor
comparison editor.luan @ 25:ce3d1dc406a8
work
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Thu, 10 Apr 2025 11:41:25 -0600 |
| parents | da93a58e24aa |
| children | ba895419fb04 |
comparison
equal
deleted
inserted
replaced
| 24:da93a58e24aa | 25:ce3d1dc406a8 |
|---|---|
| 29 local create_empty_border = Border.create_empty_border or error() | 29 local create_empty_border = Border.create_empty_border or error() |
| 30 local create_line_border = Border.create_line_border or error() | 30 local create_line_border = Border.create_line_border or error() |
| 31 local Layout = require "luan:swing/Layout.luan" | 31 local Layout = require "luan:swing/Layout.luan" |
| 32 local new_flow_layout = Layout.new_flow_layout or error() | 32 local new_flow_layout = Layout.new_flow_layout or error() |
| 33 local new_box_layout = Layout.new_box_layout or error() | 33 local new_box_layout = Layout.new_box_layout or error() |
| 34 local new_mig_layout = Layout.new_mig_layout or error() | |
| 34 local Option_pane = require "luan:swing/Option_pane.luan" | 35 local Option_pane = require "luan:swing/Option_pane.luan" |
| 35 local show_message_dialog = Option_pane.show_message_dialog or error() | 36 local show_message_dialog = Option_pane.show_message_dialog or error() |
| 36 local show_input_dialog = Option_pane.show_input_dialog or error() | 37 local show_input_dialog = Option_pane.show_input_dialog or error() |
| 37 local new_dialog = require("luan:swing/Dialog.luan").new or error() | 38 local new_dialog = require("luan:swing/Dialog.luan").new or error() |
| 38 local new_panel = require("luan:swing/Component.luan").new_panel or error() | 39 local new_panel = require("luan:swing/Component.luan").new_panel or error() |
| 39 local new_button = require("luan:swing/Button.luan").new or error() | 40 local new_button = require("luan:swing/Button.luan").new or error() |
| 41 local new_text_field = require("luan:swing/Text_field.luan").new or error() | |
| 40 local Logging = require "luan:logging/Logging.luan" | 42 local Logging = require "luan:logging/Logging.luan" |
| 41 local logger = Logging.logger "editor" | 43 local logger = Logging.logger "editor" |
| 42 | 44 |
| 43 | 45 |
| 44 local new_window | 46 local new_window |
| 190 end | 192 end |
| 191 | 193 |
| 192 local function make_find_dialog(window) | 194 local function make_find_dialog(window) |
| 193 local dialog = new_dialog{ | 195 local dialog = new_dialog{ |
| 194 owner_frame = window.frame | 196 owner_frame = window.frame |
| 197 --[[ | |
| 195 content_pane = new_panel{ | 198 content_pane = new_panel{ |
| 196 layout = function(this) return new_box_layout(this,"y_axis") end | 199 layout = function(this) return new_box_layout(this,"y_axis") end |
| 197 children = { | 200 children = { |
| 201 new_panel{ | |
| 202 layout = new_flow_layout() | |
| 203 children = { | |
| 204 new_text_field{ | |
| 205 columns = 10 | |
| 206 } | |
| 207 } | |
| 208 } | |
| 198 new_panel{ | 209 new_panel{ |
| 199 layout = new_flow_layout("left") | 210 layout = new_flow_layout("left") |
| 200 --border = create_empty_border(8,8,8,8) | 211 --border = create_empty_border(8,8,8,8) |
| 201 border = create_line_border(int_to_color(0)) | 212 border = create_line_border(int_to_color(0)) |
| 202 children = { | 213 children = { |
| 208 } | 219 } |
| 209 } | 220 } |
| 210 } | 221 } |
| 211 } | 222 } |
| 212 } | 223 } |
| 224 ]] | |
| 225 --[[ | |
| 226 content_pane = new_panel{ | |
| 227 layout = new_grid_bag_layout() | |
| 228 alignment_x = "left" | |
| 229 border = create_line_border(int_to_color(0)) | |
| 230 children = { | |
| 231 new_text_field{ | |
| 232 constraints = new_grid_bag_constraints{ | |
| 233 gridx = 1 | |
| 234 gridy = 1 | |
| 235 } | |
| 236 columns = 10 | |
| 237 border = create_line_border(int_to_color(0)) | |
| 238 } | |
| 239 new_panel{ | |
| 240 constraints = new_grid_bag_constraints{ | |
| 241 gridx = 1 | |
| 242 gridy = 2 | |
| 243 } | |
| 244 layout = new_flow_layout("left") | |
| 245 --border = create_empty_border(8,8,8,8) | |
| 246 border = create_line_border(int_to_color(0)) | |
| 247 children = { | |
| 248 new_button{ | |
| 249 text = "Find Next" | |
| 250 } | |
| 251 new_button{ | |
| 252 text = "Find Previous" | |
| 253 } | |
| 254 } | |
| 255 } | |
| 256 } | |
| 257 } | |
| 258 ]] | |
| 259 ---[[ | |
| 260 content_pane = new_panel{ | |
| 261 layout = new_mig_layout("debug","[][grow]","[][grow,top]") | |
| 262 children = { | |
| 263 new_label{ | |
| 264 text = "Find Next:" | |
| 265 } | |
| 266 new_text_field{ | |
| 267 constraints = "wrap,growx" | |
| 268 columns = 20 | |
| 269 } | |
| 270 new_panel{ | |
| 271 constraints = "span,wrap" | |
| 272 layout = new_mig_layout("debug,insets 0") | |
| 273 --border = create_empty_border(8,8,8,8) | |
| 274 --border = create_line_border(int_to_color(0)) | |
| 275 children = { | |
| 276 new_button{ | |
| 277 constraints = "pad 0 -6 0 -6" | |
| 278 text = "Find Next" | |
| 279 } | |
| 280 new_button{ | |
| 281 constraints = "pad 0 -18 0 -6, gap unrelated" | |
| 282 text = "Find Previous" | |
| 283 } | |
| 284 } | |
| 285 } | |
| 286 new_panel{ | |
| 287 constraints = "span" | |
| 288 layout = function(this) return new_box_layout(this,"x_axis") end | |
| 289 children = { | |
| 290 new_button{ | |
| 291 text = "Find Next" | |
| 292 } | |
| 293 new_button{ | |
| 294 text = "Find Previous" | |
| 295 } | |
| 296 } | |
| 297 } | |
| 298 } | |
| 299 } | |
| 300 --]] | |
| 213 } | 301 } |
| 214 dialog.pack() | 302 dialog.pack() |
| 215 local was_shown = false | 303 local was_shown = false |
| 216 function window.show_find_dialog() | 304 function window.show_find_dialog() |
| 217 if not was_shown then | 305 if not was_shown then |
